EncodeValues encodes a 0 as false, 1 as true, and nil as unknown. All other values cause an error.
(key string, v *url.Values)
| 585 | // EncodeValues encodes a 0 as false, 1 as true, and nil as unknown. All other |
| 586 | // values cause an error. |
| 587 | func (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. |
nothing calls this directly
no outgoing calls
no test coverage detected