commit | 717cb74907f3597850398a48a52f1a19a3beb447 | [log] [tgz] |
---|---|---|
author | Matthew Dempsky <mdempsky@google.com> | Thu Mar 05 17:45:11 2015 -0800 |
committer | Rob Pike <r@golang.org> | Tue Mar 24 00:01:40 2015 +0000 |
tree | ee9c9041a8a8a1483957bcd4777340e2649a53d4 | |
parent | b2f29511dd1b8760de5c4a0db284e68e8e7dddcd [diff] |
cmd/internal/ld: edit into more idiomatic Go code Instead of reimplementing chained hash tables, just use maps. Use bool instead of uint8 for variables only set to 0 or 1. Fix parsing of `import foo "foo" // indirect` lines. Previously, this was treated as an import of package path `"foo" // indirect`, which could result in the cycle-detection code failing to detect a cycle because it would be treated as a separate package from `"foo"`. Also, since there are theoretically multiple quoted forms for a package path, use strconv.Unquote to normalize them. Side benefit: Unquote will complain if any trailing comments sneak back in. Aside: For most Go archives, Go package data is only present in the __.PKGDEF member, but unless -u is used, ldpkg is only called on the _go_.6 member. Consequently, importcycles is a no-op when -u isn't used as it has no package data to inspect. Change-Id: I7076cf91a66726a8d9c5676adfea13c5532001fa Reviewed-on: https://go-review.googlesource.com/7002 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Rob Pike <r@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
For documentation about how to install and use Go, visit https://golang.org/ or load doc/install-source.html in your web browser.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Please report issues here: https://golang.org/issue/new
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this file). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install-source.html). You should also add the Go binary directory $GOROOT/bin to your shell's path.
For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile:
export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin
See https://golang.org/doc/install or doc/install.html for more details.