美文网首页
Build go from source

Build go from source

作者: 峳堆 | 来源:发表于2016-08-28 13:13 被阅读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
  • Clone source
$ 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!

相关文章

网友评论

      本文标题:Build go from source

      本文链接:https://www.haomeiwen.com/subject/xxgtettx.html