MCPcopy
hub / github.com/NVIDIA/aistore / CopyStruct

Function CopyStruct

cmn/cos/common.go:298–306  ·  view source on GitHub ↗

shallow copy

(dst, src interface{})

Source from the content-addressed store, hash-verified

296
297// shallow copy
298func CopyStruct(dst, src interface{}) {
299 x := reflect.ValueOf(src)
300 debug.Assert(x.Kind() == reflect.Ptr)
301 starX := x.Elem()
302 y := reflect.New(starX.Type())
303 starY := y.Elem()
304 starY.Set(starX)
305 reflect.ValueOf(dst).Elem().Set(y.Elem())
306}
307
308func Infof(format string, a ...interface{}) {
309 if flag.Parsed() {

Callers 11

DefaultPropsMethod · 0.92
CloneMethod · 0.92
common_test.goFile · 0.92
CloneMethod · 0.92
sendSliceMethod · 0.92
CloneMethod · 0.92
_runMethod · 0.92
cloneMethod · 0.92
cloneMethod · 0.92
WaitForClusterStateFunction · 0.92
CloneMethod · 0.92

Calls 5

AssertFunction · 0.92
KindMethod · 0.65
NewMethod · 0.65
TypeMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected