wire: reword the deprecation message of struct (#158)

This commit is contained in:
shantuo
2019-04-23 13:27:33 -07:00
committed by GitHub
parent b1c66a196d
commit d079521b6f

View File

@@ -753,9 +753,10 @@ func processStructLiteralProvider(fset *token.FileSet, typeName *types.TypeName)
pos := typeName.Pos() pos := typeName.Pos()
fmt.Fprintf(os.Stderr, fmt.Fprintf(os.Stderr,
"Deprecated: %v, see https://godoc.org/github.com/google/wire#Struct for more information.", "Warning: %v, see https://godoc.org/github.com/google/wire#Struct for more information.\n",
notePosition(fset.Position(pos), notePosition(fset.Position(pos),
fmt.Errorf("using struct literal to inject %s, use wire.Struct instead", typeName.Type()))) fmt.Errorf("using struct literal to inject %s is deprecated and will be removed in the next release; use wire.Struct instead",
typeName.Type())))
provider := &Provider{ provider := &Provider{
Pkg: typeName.Pkg(), Pkg: typeName.Pkg(),
Name: typeName.Name(), Name: typeName.Name(),