mirror of
https://github.com/golang/go
synced 2024-11-19 03:14:42 -07:00
go.tools/go/types: use unqualified names for local objects in error messages
LGTM=adonovan R=adonovan CC=golang-codereviews https://golang.org/cl/77590043
This commit is contained in:
parent
5893c271ff
commit
62216e60bb
@ -27,16 +27,19 @@ func (check *checker) sprintf(format string, args ...interface{}) string {
|
||||
for i, arg := range args {
|
||||
switch a := arg.(type) {
|
||||
case nil:
|
||||
args[i] = "<nil>"
|
||||
arg = "<nil>"
|
||||
case operand:
|
||||
panic("internal error: should always pass *operand")
|
||||
case token.Pos:
|
||||
args[i] = check.fset.Position(a).String()
|
||||
arg = check.fset.Position(a).String()
|
||||
case ast.Expr:
|
||||
args[i] = ExprString(a)
|
||||
arg = ExprString(a)
|
||||
case Object:
|
||||
arg = ObjectString(check.pkg, a)
|
||||
case Type:
|
||||
args[i] = TypeString(check.pkg, a)
|
||||
arg = TypeString(check.pkg, a)
|
||||
}
|
||||
args[i] = arg
|
||||
}
|
||||
return fmt.Sprintf(format, args...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user