mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #106785 from kidlj/cleanup_typeFrom_made_twice
cleanup: use present typeFrom variable to avoid another reflect.TypeOf call
This commit is contained in:
commit
6fb84b9d68
@ -179,7 +179,7 @@ func (c *Converter) RegisterGeneratedUntypedConversionFunc(a, b interface{}, fn
|
|||||||
func (c *Converter) RegisterIgnoredConversion(from, to interface{}) error {
|
func (c *Converter) RegisterIgnoredConversion(from, to interface{}) error {
|
||||||
typeFrom := reflect.TypeOf(from)
|
typeFrom := reflect.TypeOf(from)
|
||||||
typeTo := reflect.TypeOf(to)
|
typeTo := reflect.TypeOf(to)
|
||||||
if reflect.TypeOf(from).Kind() != reflect.Ptr {
|
if typeFrom.Kind() != reflect.Ptr {
|
||||||
return fmt.Errorf("expected pointer arg for 'from' param 0, got: %v", typeFrom)
|
return fmt.Errorf("expected pointer arg for 'from' param 0, got: %v", typeFrom)
|
||||||
}
|
}
|
||||||
if typeTo.Kind() != reflect.Ptr {
|
if typeTo.Kind() != reflect.Ptr {
|
||||||
|
Loading…
Reference in New Issue
Block a user