slider

还是菜鸟
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

build developemnt environment for go

Posted on 2013-05-22 21:14  slider  阅读(259)  评论(0编辑  收藏  举报

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