Merge pull request #11911 from uluyol/fix-doc-deepcopy

Update documentation for deep copy functions
This commit is contained in:
Mike Danese
2015-07-29 10:28:41 -07:00

View File

@@ -84,14 +84,14 @@ func verifyDeepCopyFunctionSignature(ft reflect.Type) error {
} }
// RegisterGeneratedDeepCopyFunc registers a copying func with the Cloner. // RegisterGeneratedDeepCopyFunc registers a copying func with the Cloner.
// deepCopyFunc must take two parameters: a type and a pointer to Cloner // deepCopyFunc must take three parameters: a type input, a pointer to a
// and return an element of the same type and an error. // type output, and a pointer to Cloner. It should return an error.
// //
// Example: // Example:
// c.RegisterGeneratedDeepCopyFunc( // c.RegisterGeneratedDeepCopyFunc(
// func(in Pod, c *Cloner) (Pod, error) { // func(in Pod, out *Pod, c *Cloner) error {
// // deep copy logic... // // deep copy logic...
// return copy, nil // return nil
// }) // })
func (c *Cloner) RegisterDeepCopyFunc(deepCopyFunc interface{}) error { func (c *Cloner) RegisterDeepCopyFunc(deepCopyFunc interface{}) error {
fv := reflect.ValueOf(deepCopyFunc) fv := reflect.ValueOf(deepCopyFunc)