0%

go 入门

首先配置仓库来源

天朝特殊环境,不得不配置为国内的源

打开终端并执行

1
2
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

macOS 或 Linux

1
2
3
4
5
6
7
8

export GO111MODULE=on
export GOPROXY=https://goproxy.cn

# 或者
echo "export GO111MODULE=on" >> ~/.profile
echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
source ~/.profile

windows

1
2
$env:GO111MODULE = "on"
$env:GOPROXY = "https://goproxy.cn"

相关Go资料

Goproxy 中国

Go语言101

Go官方语言规范 - 英文:据说看完此文档,Go基本就入门了

Go by Example:通过实践入门

7天用Go从零实现Web框架Gee教程