1
0
mirror of https://github.com/golang/go synced 2024-11-18 06:54:49 -07:00

refactor/rename: add line number to ambiguityError

Updates golang/go#19906

Change-Id: If13c828541cdb3937e5e970dd8add7615d36d866
Reviewed-on: https://go-review.googlesource.com/40171
Reviewed-by: David R. Jenni <david.r.jenni@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Josh Bleecher Snyder 2017-04-10 07:18:22 -07:00 committed by Alan Donovan
parent 1dbffd0798
commit aaeb897338

View File

@ -558,8 +558,8 @@ func ambiguityError(fset *token.FileSet, objects []types.Object) error {
buf.WriteString(", ")
}
posn := fset.Position(obj.Pos())
fmt.Fprintf(&buf, "%s at %s:%d",
objectKind(obj), filepath.Base(posn.Filename), posn.Column)
fmt.Fprintf(&buf, "%s at %s:%d:%d",
objectKind(obj), filepath.Base(posn.Filename), posn.Line, posn.Column)
}
return fmt.Errorf("ambiguous specifier %s matches %s",
objects[0].Name(), buf.String())