Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 400 for marshaling (0.21 sec)

  1. src/math/big/intmarsh_test.go

    			}
    		}
    	}
    }
    
    func TestIntJSONEncodingNil(t *testing.T) {
    	var x *Int
    	b, err := x.MarshalJSON()
    	if err != nil {
    		t.Fatalf("marshaling of nil failed: %s", err)
    	}
    	got := string(b)
    	want := "null"
    	if got != want {
    		t.Fatalf("marshaling of nil failed: got %s want %s", got, want)
    	}
    }
    
    func TestIntXMLEncoding(t *testing.T) {
    	for _, test := range encodingTests {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 07 23:27:14 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  2. pkg/apis/core/json.go

    */
    
    package core
    
    import "encoding/json"
    
    // This file implements json marshaling/unmarshaling interfaces on objects that are currently marshaled into annotations
    // to prevent anyone from marshaling these internal structs.
    
    var _ = json.Marshaler(&AvoidPods{})
    var _ = json.Unmarshaler(&AvoidPods{})
    
    // MarshalJSON panics to prevent marshalling of internal structs
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 25 18:06:51 UTC 2019
    - 1.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_proto.go

    	if m == nil {
    		return &Timestamp{}
    	}
    
    	// truncate precision to microseconds to match JSON marshaling/unmarshaling
    	truncatedNanoseconds := time.Duration(m.Time.Nanosecond()).Truncate(time.Microsecond)
    	return &Timestamp{
    		Seconds: m.Time.Unix(),
    		Nanos:   int32(truncatedNanoseconds),
    	}
    }
    
    // Size implements the protobuf marshalling interface.
    func (m *MicroTime) Size() (n int) {
    	if m == nil || m.Time.IsZero() {
    		return 0
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 02 08:21:04 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_proto.go

    	m.Time = time.Unix(p.Seconds, int64(0)).Local()
    	return nil
    }
    
    // Marshal implements the protobuf marshaling interface.
    func (m *Time) Marshal() (data []byte, err error) {
    	if m == nil || m.Time.IsZero() {
    		return nil, nil
    	}
    	return m.ProtoTime().Marshal()
    }
    
    // MarshalTo implements the protobuf marshaling interface.
    func (m *Time) MarshalTo(data []byte) (int, error) {
    	if m == nil || m.Time.IsZero() {
    		return 0, nil
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jul 25 18:54:00 UTC 2019
    - 3.3K bytes
    - Viewed (0)
  5. src/math/big/ratmarsh_test.go

    			var tx Rat
    			tx.SetString(num + "/" + denom)
    			b, err := json.Marshal(&tx)
    			if err != nil {
    				t.Errorf("marshaling of %s failed: %s", &tx, err)
    				continue
    			}
    			var rx Rat
    			if err := json.Unmarshal(b, &rx); err != nil {
    				t.Errorf("unmarshaling of %s failed: %s", &tx, err)
    				continue
    			}
    			if rx.Cmp(&tx) != 0 {
    				t.Errorf("JSON encoding of %s failed: got %s want %s", &tx, &rx, &tx)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 11 20:20:16 UTC 2022
    - 3.3K bytes
    - Viewed (0)
  6. src/encoding/encoding.go

    // as they can be used for serialization in communicating with programs
    // written with different library versions.
    // The policy for packages maintained by the Go project is to only allow
    // the addition of marshaling functions if no existing, reasonable marshaling exists.
    package encoding
    
    // BinaryMarshaler is the interface implemented by an object that can
    // marshal itself into a binary form.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 19:43:37 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  7. pilot/pkg/util/protoconv/protoconv.go

    	out, err := MessageToAnyWithError(msg)
    	if err != nil {
    		log.Error(fmt.Sprintf("error marshaling Any %s: %v", prototext.Format(msg), err))
    		return nil
    	}
    	return out
    }
    
    func TypedStructWithFields(typeURL string, fields map[string]interface{}) *anypb.Any {
    	value, err := structpb.NewStruct(fields)
    	if err != nil {
    		log.Error(fmt.Sprintf("error marshaling struct %s: %v", typeURL, err))
    	}
    	return MessageToAny(&udpa.TypedStruct{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 02 04:55:40 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  8. src/encoding/asn1/common.go

    	tag          *int   // the EXPLICIT or IMPLICIT tag (maybe nil).
    	stringType   int    // the string tag to use when marshaling.
    	timeType     int    // the time tag to use when marshaling.
    	set          bool   // true iff this should be encoded as a SET
    	omitEmpty    bool   // true iff this should be omitted if empty when marshaling.
    
    	// Invariants:
    	//   if explicit is set, tag is non-nil.
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 06 15:53:04 UTC 2021
    - 5.5K bytes
    - Viewed (0)
  9. doc/next/6-stdlib/99-minor/encoding/binary/60023.md

    The new [Encode] and [Decode] functions are byte slice equivalents
    to [Read] and [Write].
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 18:58:26 UTC 2024
    - 157 bytes
    - Viewed (0)
  10. test/codegen/issue60673.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package codegen
    
    //go:noinline
    func f(x int32) {
    }
    
    func g(p *int32) {
    	// argument marshaling code should live at line 17, not line 15.
    	x := *p
    	// 386: `MOVL\s[A-Z]+,\s\(SP\)`
    	f(x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 12 20:34:37 UTC 2023
    - 360 bytes
    - Viewed (0)
Back to top