]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: improve go.importpath.* docs
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 11 Mar 2016 19:57:11 +0000 (11:57 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 11 Mar 2016 20:50:10 +0000 (20:50 +0000)
While we're here, remove a bit of dead code.

Change-Id: I1344bb41e5d368825ca5748189382f9e7023c59a
Reviewed-on: https://go-review.googlesource.com/20596
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/reflect.go

index b9cc215c8e1f43058a3bf9c2d66c527b48571502..cd39969258f51c553dd9249d2980819167739dcd 100644 (file)
@@ -452,15 +452,12 @@ func dgopkgpath(s *Sym, ot int, pkg *Pkg) int {
        }
 
        if pkg == localpkg && myimportpath == "" {
-               // If we don't know the full path of the package being compiled (i.e. -p
-               // was not passed on the compiler command line), emit reference to
-               // go.importpath.""., which 6l will rewrite using the correct import path.
+               // If we don't know the full import path of the package being compiled
+               // (i.e. -p was not passed on the compiler command line), emit a reference to
+               // go.importpath.""., which the linker will rewrite using the correct import path.
                // Every package that imports this one directly defines the symbol.
-               var ns *Sym
-
-               if ns == nil {
-                       ns = Pkglookup("importpath.\"\".", mkpkg("go"))
-               }
+               // See also https://groups.google.com/forum/#!topic/golang-dev/myb9s53HxGQ.
+               ns := Pkglookup("importpath.\"\".", mkpkg("go"))
                return dsymptr(s, ot, ns, 0)
        }