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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2021-07-28
  • 2021-11-02
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-24
  • 2021-08-09
  • 2022-12-23
  • 2021-09-27
  • 2021-12-07
  • 2021-08-04
  • 2022-12-23
相关资源
相似解决方案