conversion-gen: make duplicate func error message readable

This commit is contained in:
Dr. Stefan Schimanski 2017-03-14 17:35:41 +01:00
parent 5e29e1ee05
commit 26662b39a7

View File

@ -160,7 +160,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: %#v", key))
panic(fmt.Sprintf("duplicate static conversion defined: %s -> %s", key.inType, key.outType))
}
manualMap[key] = f
}