A Sink receives data from a Get call. Implementation of Getter must call exactly one of the Set methods on success.
| 27 | // Implementation of Getter must call exactly one of the Set methods |
| 28 | // on success. |
| 29 | type Sink interface { |
| 30 | // SetString sets the value to s. |
| 31 | SetString(s string) error |
| 32 | |
| 33 | // SetBytes sets the value to the contents of v. |
| 34 | // The caller retains ownership of v. |
| 35 | SetBytes(v []byte) error |
| 36 | |
| 37 | // SetProto sets the value to the encoded version of m. |
| 38 | // The caller retains ownership of m. |
| 39 | SetProto(m proto.Message) error |
| 40 | |
| 41 | // view returns a frozen view of the bytes for caching. |
| 42 | view() (ByteView, error) |
| 43 | } |
| 44 | |
| 45 | func cloneBytes(b []byte) []byte { |
| 46 | c := make([]byte, len(b)) |
no outgoing calls
no test coverage detected
searching dependent graphs…