官方下载地址 :https://code.visualstudio.com/
如果不习惯英文可以安装中文插件
Installing github.com/mdempsky/gocode FAILED
Installing github.com/ramya-rao-a/go-outline FAILED
Installing github.com/acroca/go-symbols FAILED
Installing golang.org/x/tools/cmd/guru FAILED
Installing golang.org/x/tools/cmd/gorename FAILED
Installing github.com/stamblerre/gocode FAILED
Installing github.com/ianthehat/godef FAILED
Installing github.com/sqs/goreturns FAILED
Installing golang.org/x/lint/golint FAILED
??"Win + r" 打开 "cmd", "Go 1.13" 以上版本默认启用
C:\Users\Administrator>go env -w GO111MODULE=on
??设置代理
C:\Users\Administrator>go env -w GOPROXY=http://goproxy.io,direct
ps : 点击设置选择 keyboard shortcuts,右边会弹出所有快捷键目录
现在我们来创建第一个 go 程序来测试一下 :
??文件名 "go_hello.go"
package main // 声明 main 包,表明当前是一个可执行程序
import "fmt" // 导入内置 fmt 包
func main() { // main函数,是程序执行的入口
fmt.Println("hello word shawn hahahah!") // 在终端打印 Hello World!
}
使用终端(或者cmd)在 go 文件所在的目录下使用 go run [文件名]
来执行文件
PS E:\go> go run .\go_hello.go
hello word shawn hahahah!
到现在第一个go程序就已经完成了, 接下来将进入真正的go学习之旅, 人生苦短, Le‘s Go
原文:https://www.cnblogs.com/songhaixing/p/14303783.html