Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for MarshalNext (4.42 sec)

  1. src/crypto/x509/oid_test.go

    			continue
    		}
    
    		if !o2.Equal(tt.out) {
    			t.Errorf("ParseOID(%q) = %v; want = %v", tt.in, o2, tt.out)
    			continue
    		}
    
    		marshalled, err := o.MarshalText()
    		if string(marshalled) != tt.in || err != nil {
    			t.Errorf("(%#v).MarshalText() = (%v, %v); want = (%v, nil)", o, string(marshalled), err, tt.in)
    			continue
    		}
    
    		binary, err := o.MarshalBinary()
    		if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 19:10:38 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  2. src/encoding/json/encode_test.go

    type RefText int
    
    func (*RefText) MarshalText() ([]byte, error) {
    	return []byte(`"ref"`), nil
    }
    
    func (r *RefText) UnmarshalText([]byte) error {
    	*r = 13
    	return nil
    }
    
    // ValText has Marshaler methods with value receiver.
    type ValText int
    
    func (ValText) MarshalText() ([]byte, error) {
    	return []byte(`"val"`), 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)
  3. src/net/netip/netip.go

    		ret = append(ret, '%')
    		ret = append(ret, ip.Zone()...)
    	}
    	return string(ret)
    }
    
    // MarshalText implements the [encoding.TextMarshaler] interface,
    // The encoding is the same as returned by [Addr.String], with one exception:
    // If ip is the zero [Addr], the encoding is the empty string.
    func (ip Addr) MarshalText() ([]byte, error) {
    	switch ip.z {
    	case z0:
    		return []byte(""), nil
    	case z4:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 17:10:01 UTC 2024
    - 43.2K bytes
    - Viewed (0)
  4. src/net/netip/netip_test.go

    			t.Errorf("%d. for (%v, %v) String = %q; want %q", i, tt.in.Addr(), tt.in.Port(), got, tt.want)
    		}
    		mt, err := tt.in.MarshalText()
    		if err != nil {
    			t.Errorf("%d. for (%v, %v) MarshalText error: %v", i, tt.in.Addr(), tt.in.Port(), err)
    			continue
    		}
    		if string(mt) != tt.want {
    			t.Errorf("%d. for (%v, %v) MarshalText = %q; want %q", i, tt.in.Addr(), tt.in.Port(), mt, tt.want)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 17:10:01 UTC 2024
    - 54.3K bytes
    - Viewed (0)
  5. src/crypto/x509/oid.go

    		o := byte(big.NewInt(0).Rsh(n, uint(i)*7).Bits()[0])
    		o &= 0x7f
    		if i != 0 {
    			o |= 0x80
    		}
    		dst = append(dst, o)
    	}
    	return dst
    }
    
    // MarshalText implements [encoding.TextMarshaler]
    func (o OID) MarshalText() ([]byte, error) {
    	return []byte(o.String()), nil
    }
    
    // UnmarshalText implements [encoding.TextUnmarshaler]
    func (o *OID) UnmarshalText(text []byte) error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 19:10:38 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  6. src/encoding/json/encode.go

    		e.WriteString("null")
    		return
    	}
    	m, ok := v.Interface().(encoding.TextMarshaler)
    	if !ok {
    		e.WriteString("null")
    		return
    	}
    	b, err := m.MarshalText()
    	if err != nil {
    		e.error(&MarshalerError{v.Type(), err, "MarshalText"})
    	}
    	e.Write(appendString(e.AvailableBuffer(), b, opts.escapeHTML))
    }
    
    func addrTextMarshalerEncoder(e *encodeState, v reflect.Value, opts encOpts) {
    	va := v.Addr()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 36.2K bytes
    - Viewed (0)
  7. internal/config/storageclass/storage-class.go

    	if scStr == "" {
    		return nil
    	}
    	s, err := parseStorageClass(scStr)
    	if err != nil {
    		return err
    	}
    	sc.Parity = s.Parity
    	return nil
    }
    
    // MarshalText - marshals storage class string.
    func (sc *StorageClass) MarshalText() ([]byte, error) {
    	if sc.Parity != 0 {
    		return []byte(fmt.Sprintf("%s:%d", schemePrefix, sc.Parity)), nil
    	}
    	return []byte{}, nil
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  8. src/time/time_test.go

    		switch {
    		case b != nil:
    			t.Errorf("(%v).MarshalText() = %q, want nil", tt.time, b)
    		case err == nil || err.Error() != want:
    			t.Errorf("(%v).MarshalJSON() error = %v, want %v", tt.time, err, want)
    		}
    
    		want = strings.ReplaceAll(tt.want, "JSON", "Text")
    		b, err = tt.time.MarshalText()
    		switch {
    		case b != nil:
    			t.Errorf("(%v).MarshalText() = %q, want nil", tt.time, b)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:13:47 UTC 2024
    - 56.5K bytes
    - Viewed (0)
  9. src/net/ip.go

    func ipEmptyString(ip IP) string {
    	if len(ip) == 0 {
    		return ""
    	}
    	return ip.String()
    }
    
    // MarshalText implements the [encoding.TextMarshaler] interface.
    // The encoding is the same as returned by [IP.String], with one exception:
    // When len(ip) is zero, it returns an empty slice.
    func (ip IP) MarshalText() ([]byte, error) {
    	if len(ip) == 0 {
    		return []byte(""), nil
    	}
    	if len(ip) != IPv4len && len(ip) != IPv6len {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 18 03:13:26 UTC 2024
    - 13.9K bytes
    - Viewed (0)
  10. pilot/pkg/model/endpointshards.go

    	Cluster  cluster.ID
    	Provider provider.ID
    }
    
    func (sk ShardKey) String() string {
    	return string(sk.Provider) + "/" + string(sk.Cluster) // format: %s/%s
    }
    
    // MarshalText implements the TextMarshaler interface (for json key usage)
    func (sk ShardKey) MarshalText() (text []byte, err error) {
    	return []byte(sk.String()), nil
    }
    
    // EndpointShards holds the set of endpoint shards of a service. Registries update
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jun 14 04:34:37 UTC 2024
    - 15.6K bytes
    - Viewed (0)
Back to top