コード例 #1
0
func DeepCopy_v1beta1_UserInfo(in UserInfo, out *UserInfo, c *conversion.Cloner) error {
	out.Username = in.Username
	out.UID = in.UID
	if in.Groups != nil {
		in, out := in.Groups, &out.Groups
		*out = make([]string, len(in))
		copy(*out, in)
	} else {
		out.Groups = nil
	}
	if in.Extra != nil {
		in, out := in.Extra, &out.Extra
		*out = make(map[string][]string)
		for key, val := range in {
			if newVal, err := c.DeepCopy(val); err != nil {
				return err
			} else {
				(*out)[key] = newVal.([]string)
			}
		}
	} else {
		out.Extra = nil
	}
	return nil
}
コード例 #2
0
func DeepCopy_unversioned_Time(in Time, out *Time, c *conversion.Cloner) error {
	if newVal, err := c.DeepCopy(in.Time); err != nil {
		return err
	} else {
		out.Time = newVal.(time.Time)
	}
	return nil
}
コード例 #3
0
func DeepCopy_runtime_RawExtension(in RawExtension, out *RawExtension, c *conversion.Cloner) error {
	if in.Raw != nil {
		in, out := in.Raw, &out.Raw
		*out = make([]byte, len(in))
		copy(*out, in)
	} else {
		out.Raw = nil
	}
	if in.Object == nil {
		out.Object = nil
	} else if newVal, err := c.DeepCopy(in.Object); err != nil {
		return err
	} else {
		out.Object = newVal.(Object)
	}
	return nil
}