From 7dbf7c000d1dd8edadd9e16abfe6de60020ef071 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 28 Jan 2014 12:56:33 -0800 Subject: [PATCH] go.tools/go/types: internal cleanup - nil out objmap when done with it Also: print package path with quotes. LGTM=adonovan R=adonovan CC=golang-codereviews https://golang.org/cl/55520046 --- go/types/package.go | 2 +- go/types/resolver.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go/types/package.go b/go/types/package.go index 7090c17e..f09acc7f 100644 --- a/go/types/package.go +++ b/go/types/package.go @@ -50,5 +50,5 @@ func (pkg *Package) Imports() []*Package { return pkg.imports } func (pkg *Package) SetImports(list []*Package) { pkg.imports = list } func (pkg *Package) String() string { - return fmt.Sprintf("package %s (%s)", pkg.name, pkg.path) + return fmt.Sprintf("package %s (%q)", pkg.name, pkg.path) } diff --git a/go/types/resolver.go b/go/types/resolver.go index 18c9047f..3beea8a5 100644 --- a/go/types/resolver.go +++ b/go/types/resolver.go @@ -388,6 +388,7 @@ func (check *checker) resolveFiles(files []*ast.File) { check.objDecl(obj, nil, false) } } + check.objMap = nil // not needed anymore // At this point we may have a non-empty check.methods map; this means that not all // entries were deleted at the end of typeDecl because the respective receiver base