Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 120 for marshalers (0.2 sec)

  1. src/math/big/intmarsh.go

    		return fmt.Errorf("math/big: cannot unmarshal %q into a *big.Int", text)
    	}
    	return nil
    }
    
    // The JSON marshalers are only here for API backward compatibility
    // (programs that explicitly look for these two methods). JSON works
    // fine with the TextMarshaler only.
    
    // MarshalJSON implements the [encoding/json.Marshaler] interface.
    func (x *Int) MarshalJSON() ([]byte, error) {
    	if x == nil {
    		return []byte("null"), nil
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  2. src/html/template/js.go

    	// "<!--", "-->", "<![CDATA[", "]]>", or "</script"
    	// in case custom marshalers produce output containing those.
    	// Note: Do not use \x escaping to save bytes because it is not JSON compatible and this escaper
    	// supports ld+json content-type.
    	if len(b) == 0 {
    		// In, `x=y/{{.}}*z` a json.Marshaler that produces "" should
    		// not cause the output `x=y/*z`.
    		return " null "
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  3. src/encoding/xml/marshal_test.go

    		},
    	},
    
    	// Test omitempty with parent chain; see golang.org/issue/4168.
    	{
    		ExpectXML: `<Strings><A></A></Strings>`,
    		Value:     &Strings{},
    	},
    	// Custom marshalers.
    	{
    		ExpectXML: `<MyMarshalerTest>hello world</MyMarshalerTest>`,
    		Value:     &MyMarshalerTest{},
    	},
    	{
    		ExpectXML: `<MarshalerStruct Foo="hello world"></MarshalerStruct>`,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 18:46:41 UTC 2024
    - 66K bytes
    - Viewed (0)
  4. pkg/util/protomarshal/protomarshal.go

    	}
    
    	// Marshal from proto to json bytes
    	m := jsonpb.Marshaler{Indent: indent, EnumsAsInts: enumsAsInts}
    	return m.MarshalToString(legacyproto.MessageV1(msg))
    }
    
    func ToJSONWithAnyResolver(msg proto.Message, indent string, anyResolver jsonpb.AnyResolver) (string, error) {
    	if msg == nil {
    		return "", errors.New("unexpected nil message")
    	}
    
    	m := jsonpb.Marshaler{
    		Indent:      indent,
    		AnyResolver: anyResolver,
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Mar 12 10:02:09 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  5. src/encoding/xml/marshal.go

    		start.Name.Local = typ.Name()
    	} else {
    		// Must be a pointer to a named type,
    		// since it has the Marshaler methods.
    		start.Name.Local = typ.Elem().Name()
    	}
    	return start
    }
    
    // marshalInterface marshals a Marshaler interface value.
    func (p *printer) marshalInterface(val Marshaler, start StartElement) error {
    	// Push a marker onto the tag stack so that MarshalXML
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 18:46:41 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  6. src/encoding/json/encode_test.go

    		t.Errorf("Marshal:\n\tgot:  %s\n\twant: %s", got, want)
    	}
    }
    
    // Ref has Marshaler and Unmarshaler methods with pointer receiver.
    type Ref int
    
    func (*Ref) MarshalJSON() ([]byte, error) {
    	return []byte(`"ref"`), nil
    }
    
    func (r *Ref) UnmarshalJSON([]byte) error {
    	*r = 12
    	return nil
    }
    
    // Val has Marshaler methods with value receiver.
    type Val int
    
    func (Val) MarshalJSON() ([]byte, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 29.4K bytes
    - Viewed (0)
  7. src/encoding/json/encode.go

    	_ "unsafe" // for linkname
    )
    
    // Marshal returns the JSON encoding of v.
    //
    // Marshal traverses the value v recursively.
    // If an encountered value implements [Marshaler]
    // and is not a nil pointer, Marshal calls [Marshaler.MarshalJSON]
    // to produce JSON. If no [Marshaler.MarshalJSON] method is present but the
    // value implements [encoding.TextMarshaler] instead, Marshal calls
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 36.2K bytes
    - Viewed (0)
  8. src/crypto/hmac/hmac.go

    type hmac struct {
    	opad, ipad   []byte
    	outer, inner hash.Hash
    
    	// If marshaled is true, then opad and ipad do not contain a padded
    	// copy of the key, but rather the marshaled state of outer/inner after
    	// opad/ipad has been fed into it.
    	marshaled bool
    }
    
    func (h *hmac) Sum(in []byte) []byte {
    	origLen := len(in)
    	in = h.inner.Sum(in)
    
    	if h.marshaled {
    		if err := h.outer.(marshalable).UnmarshalBinary(h.opad); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  9. cmd/object-api-interface_gen.go

    package cmd
    
    // Code generated by github.com/tinylib/msgp DO NOT EDIT.
    
    import (
    	"github.com/tinylib/msgp/msgp"
    )
    
    // MarshalMsg implements msgp.Marshaler
    func (z BucketOptions) MarshalMsg(b []byte) (o []byte, err error) {
    	o = msgp.Require(b, z.Msgsize())
    	// map header, size 2
    	// string "Deleted"
    	o = append(o, 0x82, 0xa7, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64)
    	o = msgp.AppendBool(o, z.Deleted)
    	// string "Cached"
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Mar 08 19:08:18 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  10. internal/bucket/replication/datatypes_gen.go

    func (z StatusType) EncodeMsg(en *msgp.Writer) (err error) {
    	err = en.WriteString(string(z))
    	if err != nil {
    		err = msgp.WrapError(err)
    		return
    	}
    	return
    }
    
    // MarshalMsg implements msgp.Marshaler
    func (z StatusType) MarshalMsg(b []byte) (o []byte, err error) {
    	o = msgp.Require(b, z.Msgsize())
    	o = msgp.AppendString(o, string(z))
    	return
    }
    
    // UnmarshalMsg implements msgp.Unmarshaler
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Mar 08 19:08:18 UTC 2024
    - 2.3K bytes
    - Viewed (0)
Back to top