Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 411 for marshal1 (0.18 sec)

  1. src/cmd/dist/testjson.go

    	var buf bytes.Buffer
    	var marshal1 func(v jsonValue) error
    	marshal1 = func(v jsonValue) error {
    		if t, ok := v.atom.(json.Delim); ok {
    			buf.WriteRune(rune(t))
    			for i, v2 := range v.seq {
    				if t == '{' && i%2 == 1 {
    					buf.WriteByte(':')
    				} else if i > 0 {
    					buf.WriteByte(',')
    				}
    				if err := marshal1(v2); err != nil {
    					return err
    				}
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 20:46:32 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  2. src/encoding/xml/marshal.go

    const (
    	// Header is a generic XML header suitable for use with the output of [Marshal].
    	// This is not automatically added to any output of this package,
    	// it is provided as a convenience.
    	Header = `<?xml version="1.0" encoding="UTF-8"?>` + "\n"
    )
    
    // Marshal returns the XML encoding of v.
    //
    // Marshal handles an array or slice by marshaling each of the elements.
    // Marshal handles a pointer by marshaling the value it points at or, if the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 18:46:41 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  3. src/encoding/asn1/marshal.go

    	return t, nil
    }
    
    // Marshal returns the ASN.1 encoding of val.
    //
    // In addition to the struct tags recognized by Unmarshal, the following can be
    // used:
    //
    //	ia5:         causes strings to be marshaled as ASN.1, IA5String values
    //	omitempty:   causes empty slices to be skipped
    //	printable:   causes strings to be marshaled as ASN.1, PrintableString values
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  4. cmd/kubeadm/app/util/marshal.go

    	"k8s.io/kubernetes/cmd/kubeadm/app/constants"
    )
    
    // MarshalToYaml marshals an object into yaml.
    func MarshalToYaml(obj runtime.Object, gv schema.GroupVersion) ([]byte, error) {
    	return MarshalToYamlForCodecs(obj, gv, clientsetscheme.Codecs)
    }
    
    // MarshalToYamlForCodecs marshals an object into yaml using the specified codec
    // TODO: Is specifying the gv really needed here?
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 29 05:14:21 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  5. pkg/util/protomarshal/protomarshal.go

    		DiscardUnknown: true,
    		Resolver:       anyResolver,
    	}).Unmarshal(b, m)
    }
    
    // ToJSON marshals a proto to canonical JSON
    func ToJSON(msg proto.Message) (string, error) {
    	return ToJSONWithIndent(msg, "")
    }
    
    // Marshal marshals a proto to canonical JSON
    func Marshal(msg proto.Message) ([]byte, error) {
    	res, err := ToJSONWithIndent(msg, "")
    	if err != nil {
    		return nil, err
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Mar 12 10:02:09 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  6. src/encoding/json/encode_test.go

    	s := renamedByteSlice("abc")
    	got, err := Marshal(s)
    	if err != nil {
    		t.Fatalf("Marshal error: %v", err)
    	}
    	want := `"YWJj"`
    	if string(got) != want {
    		t.Errorf("Marshal:\n\tgot:  %s\n\twant: %s", got, want)
    	}
    	r := renamedRenamedByteSlice("abc")
    	got, err = Marshal(r)
    	if err != nil {
    		t.Fatalf("Marshal error: %v", err)
    	}
    	if string(got) != want {
    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

    	"unicode/utf8"
    	_ "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. operator/pkg/apis/istio/v1alpha1/value_types_json.go

    	return nil
    }
    
    func (this *IntOrString) MarshalJSONPB(_ *github_com_golang_protobuf_jsonpb.Marshaler) ([]byte, error) {
    	return this.MarshalJSON()
    }
    
    func (this *IntOrString) MarshalJSON() ([]byte, error) {
    	if this.IntVal != nil {
    		return json.Marshal(this.IntVal.GetValue())
    	}
    	return json.Marshal(this.StrVal.GetValue())
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Apr 21 17:42:54 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  9. src/encoding/xml/marshal_test.go

    	if got != want {
    		t.Fatalf("unexpected unmarshal result, want %f but got %f", want, got)
    	}
    
    	// Marshal again (or Encode again)
    	// In issue 50164, here `Marshal(l1)` will panic because of the zero value of xml attribute ValueTwo `value_two`.
    	anotherXML, err := Marshal(l1)
    	if err != nil {
    		t.Fatalf("marshal XML error: %v", err)
    	}
    	if string(anotherXML) != proofXml {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 18:46:41 UTC 2024
    - 66K bytes
    - Viewed (0)
  10. src/internal/chacha8rand/chacha8.go

    				break
    			}
    			s.Refill()
    		}
    	}
    	s.Init64(seed)
    }
    
    // Marshal marshals the state into a byte slice.
    // Marshal and Unmarshal are functions, not methods,
    // so that they will not be linked into the runtime
    // when it uses the State struct, since the runtime
    // does not need these.
    func Marshal(s *State) []byte {
    	data := make([]byte, 6*8)
    	copy(data, "chacha8:")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:47:29 UTC 2024
    - 4.4K bytes
    - Viewed (0)
Back to top