MCPcopy Create free account
hub / github.com/google/gapid / getSlice

Function getSlice

core/data/slice/slice.go:167–173  ·  view source on GitHub ↗

getSlice checks s is a slice, returning the slice as a reflect.Value.

(s interface{})

Source from the content-addressed store, hash-verified

165
166// getSlice checks s is a slice, returning the slice as a reflect.Value.
167func getSlice(s interface{}) (slice reflect.Value) {
168 slice = reflect.ValueOf(s)
169 if slice.Kind() != reflect.Slice {
170 panic(fmt.Errorf("s must be a slice, got: %T", s))
171 }
172 return slice
173}
174
175// toSlice returns the reflect.Value of v, turning it into a single element
176// slice (of type sliceTy) if it isn't a slice already.

Callers 3

SortFunction · 0.85
CloneFunction · 0.85
ReverseFunction · 0.85

Calls 1

KindMethod · 0.65

Tested by

no test coverage detected