mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
conversion-gen: Better error on duplicate objects
This commit is contained in:
parent
e9fa259451
commit
eb85c83e92
@ -175,7 +175,7 @@ func getManualConversionFunctions(context *generator.Context, pkg *types.Package
|
||||
key := conversionPair{inType.Elem, outType.Elem}
|
||||
// We might scan the same package twice, and that's OK.
|
||||
if v, ok := manualMap[key]; ok && v != nil && v.Name.Package != pkg.Path {
|
||||
panic(fmt.Sprintf("duplicate static conversion defined: %s -> %s", key.inType, key.outType))
|
||||
panic(fmt.Sprintf("duplicate static conversion defined: %s -> %s from:\n%s.%s\n%s.%s", key.inType, key.outType, v.Name.Package, v.Name.Name, f.Name.Package, f.Name.Name))
|
||||
}
|
||||
manualMap[key] = f
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user