The go command has rough edges and is not yet complete;
these notes explain how to take it out for a test drive
anyway, if you are feeling adventurous.
To try the go command, your source code needs to be in a
directory tree mentioned by $GOPATH, like you currently do
for goinstall. The main requirement is that the code be in
a directory named src/import/path, where import/path
typically begins with a host name like code.google.com or
github.com. Run 'go help gopath' for details. An example
to get you started:
export GOPATH=/tmp/hack
hg clone https://code.google.com/p/go.example \
$GOPATH/src/code.google.com/p/go.example
ls /tmp/hack/src/code.google.com/p/go.example/newmath
The go command will replace goinstall but it does not yet
implement that functionality; for now you still need to use
explicit version control commands (as above) or goinstall
(without a space) to download code.
Some recipes to try:
go list all
go list -f '{{.ImportPath}} {{.Deps}}' std
go list -f '{{.Dir}}' strconv
go list -json code.google.com/p/go.example/newmath
cd $GOPATH/src/code.google.com/p/go.example/newmath
go build
go install
go test
go test fmt .
cd $HOME
go test fmt code.google.com/p/go.example/newmath
go install code.google.com/p/go.example/hello
$GOPATH/bin/hello
go vet code.google.com/p/go.example/hello
cd $HOME
cat >x.go <<EOF
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
EOF
go run x.go
If you have questions or run into problems, please reply to this mail.
If you have complaints or suggestions for changes, please enter
them as comments at http://golang.org/issue/2606.
Thanks.
Russ