build developemnt environment for go

1.download source : http://golang.org/doc/Installed , here i haved file named 'go1.1.linux-386.tar.gz' , decompress it.

2.To build the Go distribution, run

$ cd go/src
$ ./all.bash

(To build under Windows use all.bat.)

If all goes well, it will finish by printing output like:

ALL TESTS PASSED

---
Installed Go for linux/amd64 in /home/you/go.
Installed commands in /home/you/go/bin.
*** You need to add /home/you/go/bin to your $PATH. ***

3.here, so you could add the following commands:

export GOROOT=$HOME/install_soft/go/go
export GOBIN=$GOROOT/bin
export PATH=$PATH:$GOBIN

4.craete a file name hello.go :

package main

import "fmt"

func main() {
    fmt.Printf("hello, world\n")
}

Then run it with the go tool:

$ go run hello.go
hello, world

本文来自:博客园

感谢作者:slider

查看原文:build developemnt environment for go

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。