官方下載地址 :https://code.visualstudio.com/git
若是不習慣英文能夠安裝中文插件github
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,右邊會彈出全部快捷鍵目錄golang
如今咱們來建立第一個 go 程序來測試一下 :vim
🍓文件名 "go_hello.go" package main // 聲明 main 包,代表當前是一個可執行程序 import "fmt" // 導入內置 fmt 包 func main() { // main函數,是程序執行的入口 fmt.Println("hello word shawn hahahah!") // 在終端打印 Hello World! }
使用終端(或者cmd)在 go 文件所在的目錄下使用 go run [文件名]
來執行文件windows
PS E:\go> go run .\go_hello.go hello word shawn hahahah!
到如今第一個go程序就已經完成了, 接下來將進入真正的go學習之旅, 人生苦短, Le's Go編輯器