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

Method EncodeValues

query/encode_test.go:439–447  ·  view source on GitHub ↗

EncodeValues using key name of the form "{key}.N" where N increments with each value. A value of "err" will return an error.

(key string, v *url.Values)

Source from the content-addressed store, hash-verified

437// EncodeValues using key name of the form "{key}.N" where N increments with
438// each value. A value of "err" will return an error.
439func (m customEncodedStrings) EncodeValues(key string, v *url.Values) error {
440 for i, arg := range m {
441 if arg == "err" {
442 return errors.New("encoding error")
443 }
444 v.Set(fmt.Sprintf("%s.%d", key, i), arg)
445 }
446 return nil
447}
448
449func TestValues_CustomEncodingSlice(t *testing.T) {
450 tests := []struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected