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

go.tools/go/types: include import path in (*Package).String()

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/66120045
This commit is contained in:
Alan Donovan 2014-02-19 17:55:30 -05:00
parent 9d6717b260
commit 0eac03b836

View File

@ -226,8 +226,11 @@ func writeObject(buf *bytes.Buffer, this *Package, obj Object) {
typ := obj.Type()
switch obj := obj.(type) {
case *PkgName:
buf.WriteString("package")
typ = nil
fmt.Fprintf(buf, "package %s", obj.Name())
if path := obj.Pkg().path; path != "" && path != obj.Name() {
fmt.Fprintf(buf, " (%q)", path)
}
return
case *Const:
buf.WriteString("const")