Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 380 for marshaling (0.18 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. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. src/crypto/x509/pkcs8.go

    		}
    		privKey.PrivateKey = MarshalPKCS1PrivateKey(k)
    
    	case *ecdsa.PrivateKey:
    		oid, ok := oidFromNamedCurve(k.Curve)
    		if !ok {
    			return nil, errors.New("x509: unknown curve while marshaling to PKCS#8")
    		}
    		oidBytes, err := asn1.Marshal(oid)
    		if err != nil {
    			return nil, errors.New("x509: failed to marshal curve OID: " + err.Error())
    		}
    		privKey.Algo = pkix.AlgorithmIdentifier{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct/direct.go

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    // Package direct provides functions for marshaling and unmarshaling between arbitrary Go values and
    // CBOR data, with behavior that is compatible with that of the CBOR serializer. In particular,
    // types that implement cbor.Marshaler and cbor.Unmarshaler should use these functions.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 15 15:31:10 UTC 2024
    - 1.2K bytes
    - Viewed (0)
Back to top