Skip to content
Snippets Groups Projects
Select Git revision
  • 47b9cb58bd3b0b74142ae4484f61330d066699c2
  • noblogs default
  • noblogs-5.7.1
  • upstream
  • noblogs-5.7
  • noblogs-5.6new
  • upstream5.5.1
  • noblogs28dic
  • upstream28dic
  • noblogs-5.5.1
  • noblogs-5.4.2
  • noblogs-5.4_seconda
  • noblogs-5.4
  • noblogs-7c
  • wp5.2.3p3
  • mergedbconf
  • noblogs-5.7.1
  • noblogs.5.7.0p1
  • noblogs-5.7.0
  • noblogs-5.6p3
  • noblogs5.6p2
  • noblogs-5.6p1
  • noblogs-5.6
  • noblogs-5.4.2p1
  • noblogs-5.4.2
  • noblogs-5.4.1
  • noblogs-5.4
  • noblogs-p5.4
  • noblogs-5.3.2p2
  • noblogs-5.3.2p1
  • noblogs-5.3.2
  • noblogs-5.3
  • noblogs-5.2.3p4
  • noblogs-5.2.3p3
  • noblogs-5.2.3p2
  • noblogs-5.2.3p1
36 results

class-wp-error.php

Blame
  • span_id.go 618 B
    package model
    
    import (
    	"fmt"
    	"strconv"
    )
    
    // ID type
    type ID uint64
    
    // String outputs the 64-bit ID as hex string.
    func (i ID) String() string {
    	return fmt.Sprintf("%016x", uint64(i))
    }
    
    // MarshalJSON serializes an ID type (SpanID, ParentSpanID) to HEX.
    func (i ID) MarshalJSON() ([]byte, error) {
    	return []byte(fmt.Sprintf("%q", i.String())), nil
    }
    
    // UnmarshalJSON deserializes an ID type (SpanID, ParentSpanID) from HEX.
    func (i *ID) UnmarshalJSON(b []byte) (err error) {
    	var id uint64
    	if len(b) < 3 {
    		return nil
    	}
    	id, err = strconv.ParseUint(string(b[1:len(b)-1]), 16, 64)
    	*i = ID(id)
    	return err
    }