Build go from source

2016-08-28  本文已影响0人  峳堆

参考文档

https://golang.org/doc/install/source
https://golang.org/doc/install/source#environment

准备

export GOROOT=$(pwd)/go
export GOOS=linux
export GOARCH=amd64
export GOROOT_BOOTSTRAP=$(pwd)/go1.4
$ git clone https://github.com/golang/go
$ tree -d -L 1
.
├── go
├── go1.4

编译

cd go/src
all.bash

测试

新文件 ./hello.go

package main

import "fmt"

func main() {
    fmt.Println("hello world!")
}
$ go/bin/go run hello.go
hello world!
上一篇 下一篇

猜你喜欢

热点阅读