shallow copy
(dst, src interface{})
| 296 | |
| 297 | // shallow copy |
| 298 | func 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 | |
| 308 | func Infof(format string, a ...interface{}) { |
| 309 | if flag.Parsed() { |
no test coverage detected