世上的路走多了,也就变成了烂路。
本系列主要记录自己学习Go的时候遇到的问题和笔记。(持续更新)
- Windows10 64
1. 安装 Go
-
默认安装,就没有配置环境变量了
-
如果自定义安装位置,可以配置下环境变量
打开“我的电脑”或“此电脑”
右键单击“属性” 在弹出的“系统属性”对话框中,选择“高级系统设置”。
在弹出的“系统属性”对话框中,选择“环境变量”。
在“系统变量”中,找到“Path”,并点击“编辑”。
在弹出的“编辑环境变量”对话框中,新增一个配置,输入安装后的 bin 目录路径。
# 如果安装成功,测试一下
go version
2. 安装 Goland
download-cdn.jetbrains.com.cn/go/goland-2… (破解...百度谷歌AI一下)
3. Hello World
新建 main.go 文件
package main
import "fmt"
func main() {
fmt.Println("Hello World.")
}
4. FAQ
1. go: fyne.io/fyne/v2@v2.0.4: Get "https://proxy.golang.org/fyne.io/fyne/v2/@v/v2.0.4.mod": dial tcp 142.251.42.241:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
设置代理: go env -w GOPROXY=https://goproxy.cn
2. 【不会】goland工具 terminal输出乱码, 例如 go env
TODO: ????
3. fmt.Println("aaa") 和 fmt.Println('aaa')
单引号和双引号区别
4. 【不会】package 和 main的含义
TODO: