deepcopy.go
func Copy(dst interface{}, src interface{}) error {
	if dst == nil {
		return fmt.Errorf("dst cannot be nil")
	}
	if src == nil {
		return fmt.Errorf("src cannot be nil")
	}
	bytes, err := json.Marshal(src)
	if err != nil {
		return fmt.Errorf("Unable to marshal src: %s", err)
	}
	err = json.Unmarshal(bytes, dst)
	if err != nil {
		return fmt.Errorf("Unable to unmarshal into dst: %s", err)
	}
	return nil
}
func Copy(dst interface{}, src interface{}) error {
	if dst == nil {
		return fmt.Errorf("dst cannot be nil")
	}
	if src == nil {
		return fmt.Errorf("src cannot be nil")
	}
	bytes, err := json.Marshal(src)
	if err != nil {
		return fmt.Errorf("Unable to marshal src: %s", err)
	}
	err = json.Unmarshal(bytes, dst)
	if err != nil {
		return fmt.Errorf("Unable to unmarshal into dst: %s", err)
	}
	return nil
}
func Copy ( dst interface { } , src interface { } ) error { if dst == nil { return fmt . Errorf ( " " ) } if src == nil { return fmt . Errorf ( " " ) } bytes , err := json . Marshal ( src ) if err != nil { return fmt . Errorf ( " " , err ) } err = json . Unmarshal ( bytes , dst ) if err != nil { return fmt . Errorf ( " " , err ) } return nil }
// Make a deep copy from src into dst.
Make a deep copy from src into dst .