MCPcopy Create free account
hub / github.com/google/go-querystring / EncodeValues

Method EncodeValues

query/encode_test.go:587–594  ·  view source on GitHub ↗

EncodeValues encodes a 0 as false, 1 as true, and nil as unknown. All other values cause an error.

(key string, v *url.Values)

Source from the content-addressed store, hash-verified

585// EncodeValues encodes a 0 as false, 1 as true, and nil as unknown. All other
586// values cause an error.
587func (m *customEncodedIntPtr) EncodeValues(key string, v *url.Values) error {
588 if m == nil {
589 v.Set(key, "undefined")
590 } else {
591 v.Set(key, fmt.Sprintf("_%d", *m))
592 }
593 return nil
594}
595
596// Test behavior when encoding is defined for a pointer of a custom type.
597// Custom type should be able to encode values for nil pointers.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected