go Related Resources

Website guide


installation

1.下载binrary包(zip 解压后需要配置gopath, msi 会自动配置gopath)

2.配置环境变量 
    - add 配置`gobin  C:\go\go1.13.1.windows-amd64\go\bin`   => [系统path]增加 %gobin%
    打开cmd,输入`go version`
    有显示说明配置成功,否则再排查下问题。

    - add 配置gopath  D:\go\workproject  => [系统path]增加 %gopath%
    打开cmd,输入`go env` 

    看到
    `set GOROOT=C:\go\go1.13.1.windows-amd64\go`
    `set gopath = D:\go\workproject` 
    说明配置成功


3. 开始编译go文件
        PS  cd  C:\go\go1.13.1.windows-amd64\go\test

        编译 go build hello.go
        运行 ./hello.exe
        显示  hello, world
//helloworld.go
package main
func main() {
    fmt.Printf("hello, world\n")
}

Tips:
middle If you have questions, see the official documents

Guess you like

Origin www.cnblogs.com/scotth/p/11682063.html