Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 980 for u8marshal (0.15 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/yaml/decoder.go

    	case *map[string]interface{}:
    		if err := yaml.Unmarshal(data, v, preserveIntFloat); err != nil {
    			return err
    		}
    		return jsonutil.ConvertMapNumbers(*v, 0)
    	case *[]interface{}:
    		if err := yaml.Unmarshal(data, v, preserveIntFloat); err != nil {
    			return err
    		}
    		return jsonutil.ConvertSliceNumbers(*v, 0)
    	case *interface{}:
    		if err := yaml.Unmarshal(data, v, preserveIntFloat); err != nil {
    			return err
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 19 21:24:36 UTC 2021
    - 10.2K bytes
    - Viewed (0)
  2. src/encoding/json/stream_test.go

    	err := Unmarshal([]byte(want), &data)
    	if err != nil {
    		t.Fatalf("Unmarshal error: %v", err)
    	}
    	if string([]byte(data.Id)) != raw {
    		t.Fatalf("Unmarshal:\n\tgot:  %s\n\twant: %s", []byte(data.Id), raw)
    	}
    	got, err := Marshal(&data)
    	if err != nil {
    		t.Fatalf("Marshal error: %v", err)
    	}
    	if string(got) != want {
    		t.Fatalf("Marshal:\n\tgot:  %s\n\twant: %s", got, want)
    	}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 25 16:00:37 UTC 2023
    - 12.9K bytes
    - Viewed (0)
  3. src/crypto/tls/handshake_messages.go

    // since their wire representation is idempotent. For clientHelloMsg and
    // serverHelloMsg, we store the original wire representation of the message and
    // use that for hashing, since unmarshal/marshal are not idempotent due to
    // extension ordering and other malleable fields, which may cause differences
    // between what was received and what we marshal.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 51.8K bytes
    - Viewed (0)
  4. src/encoding/json/decode.go

    // the JSON being the JSON literal null. In that case, Unmarshal sets
    // the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into
    // the value pointed at by the pointer. If the pointer is nil, Unmarshal
    // allocates a new value for it to point to.
    //
    // To unmarshal JSON into a value implementing [Unmarshaler],
    // Unmarshal calls that value's [Unmarshaler.UnmarshalJSON] method, including
    // when the input is a JSON null.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 35.3K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/objectmeta/coerce.go

    			if utiljson.Unmarshal(singleFieldBytes, testObjectMeta) == nil {
    				// if that succeeds, unmarshal for real
    				if opts.ReturnUnknownFieldPaths {
    					strictErrs, _ := kjson.UnmarshalStrict(singleFieldBytes, accumulatedObjectMeta)
    					if len(strictErrs) > 0 {
    						prefix := opts.ParentPath.Child("metadata").String()
    						for _, err := range strictErrs {
    							if fieldPathErr, ok := err.(kjson.FieldError); ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 18 14:55:12 UTC 2022
    - 5.4K bytes
    - Viewed (0)
  6. src/encoding/json/encode_test.go

    	}
    	var n int64 = 42
    	b, err := Marshal(stringPointer{N: &n})
    	if err != nil {
    		t.Fatalf("Marshal error: %v", err)
    	}
    	if got, want := string(b), `{"n":"42"}`; got != want {
    		t.Fatalf("Marshal:\n\tgot:  %s\n\twant: %s", got, want)
    	}
    	var back stringPointer
    	switch err = Unmarshal(b, &back); {
    	case err != nil:
    		t.Fatalf("Unmarshal error: %v", err)
    	case back.N == nil:
    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. operator/pkg/tpath/util.go

    func AddSpecRoot(tree string) (string, error) {
    	t, nt := make(map[string]any), make(map[string]any)
    	if err := yaml.Unmarshal([]byte(tree), &t); err != nil {
    		return "", err
    	}
    	nt["spec"] = t
    	out, err := yaml.Marshal(nt)
    	if err != nil {
    		return "", err
    	}
    	return string(out), nil
    }
    
    // GetSpecSubtree returns the subtree under "spec".
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  8. operator/pkg/apis/istio/v1alpha1/value_types_json.go

    	if value[0] == '"' {
    		this.Type = int64(intstr.String)
    		var s string
    		err := json.Unmarshal(value, &s)
    		if err != nil {
    			return err
    		}
    		this.StrVal = &wrapperspb.StringValue{Value: s}
    		return nil
    	}
    	this.Type = int64(intstr.Int)
    	var s int32
    	err := json.Unmarshal(value, &s)
    	if err != nil {
    		return err
    	}
    	this.IntVal = &wrapperspb.Int32Value{Value: s}
    	return nil
    }
    
    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. pkg/istio-agent/grpcxds/grpc_bootstrap.go

    }
    
    func (cp *CertificateProvider) UnmarshalJSON(data []byte) error {
    	var dat map[string]*json.RawMessage
    	if err := json.Unmarshal(data, &dat); err != nil {
    		return err
    	}
    	*cp = CertificateProvider{}
    
    	if pluginNameVal, ok := dat["plugin_name"]; ok {
    		if err := json.Unmarshal(*pluginNameVal, &cp.PluginName); err != nil {
    			log.Warnf("failed parsing plugin_name in certificate_provider: %v", err)
    		}
    	} else {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Mar 30 00:31:03 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  10. src/encoding/xml/read_test.go

    	p1 := &ParamPtr{}
    	if err := Unmarshal(x, p1); err != nil {
    		t.Fatalf("Unmarshal: %s", err)
    	}
    	if p1.Int == nil {
    		t.Fatalf("Unmarshal failed in to *int field")
    	} else if *p1.Int != 1 {
    		t.Fatalf("Unmarshal with %s failed:\nhave %#v,\n want %#v", x, p1.Int, 1)
    	}
    
    	p2 := &ParamVal{}
    	if err := Unmarshal(x, p2); err != nil {
    		t.Fatalf("Unmarshal: %s", err)
    	}
    	if p2.Int != 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 29.1K bytes
    - Viewed (0)
Back to top