of returns a byte view of the []byte or string in x.
(x interface{})
| 58 | |
| 59 | // of returns a byte view of the []byte or string in x. |
| 60 | func of(x interface{}) ByteView { |
| 61 | if bytes, ok := x.([]byte); ok { |
| 62 | return ByteView{b: bytes} |
| 63 | } |
| 64 | return ByteView{s: x.(string)} |
| 65 | } |
| 66 | |
| 67 | func TestByteViewEqual(t *testing.T) { |
| 68 | tests := []struct { |
no outgoing calls
no test coverage detected