A ByteView holds an immutable view of bytes. Internally it wraps either a []byte or a string, but that detail is invisible to callers. A ByteView is meant to be used as a value type, not a pointer (like a time.Time).
| 30 | // A ByteView is meant to be used as a value type, not |
| 31 | // a pointer (like a time.Time). |
| 32 | type ByteView struct { |
| 33 | // If b is non-nil, b is used, else s is used. |
| 34 | b []byte |
| 35 | s string |
| 36 | } |
| 37 | |
| 38 | // Len returns the view's length. |
| 39 | func (v ByteView) Len() int { |
nothing calls this directly
no outgoing calls
no test coverage detected