MCPcopy Index your code
hub / github.com/golang/groupcache / of

Function of

byteview_test.go:60–65  ·  view source on GitHub ↗

of returns a byte view of the []byte or string in x.

(x interface{})

Source from the content-addressed store, hash-verified

58
59// of returns a byte view of the []byte or string in x.
60func 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
67func TestByteViewEqual(t *testing.T) {
68 tests := []struct {

Callers 3

TestByteViewFunction · 0.85
TestByteViewEqualFunction · 0.85
TestByteViewSliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected