MCPcopy Index your code
hub / github.com/upper/db / reset

Function reset

internal/sqlbuilder/fetch.go:240–255  ·  view source on GitHub ↗
(data interface{})

Source from the content-addressed store, hash-verified

238}
239
240func reset(data interface{}) {
241 // Resetting element.
242 v := reflect.ValueOf(data).Elem()
243 t := v.Type()
244
245 var z reflect.Value
246
247 switch v.Kind() {
248 case reflect.Slice:
249 z = reflect.MakeSlice(t, 0, v.Cap())
250 default:
251 z = reflect.Zero(t)
252 }
253
254 v.Set(z)
255}

Callers 2

fetchRowFunction · 0.85
fetchRowsFunction · 0.85

Calls 2

KindMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected