一、到官網下載安裝包,地址是:https://golang.org/dl/ ,自選對應環境;git
二、在任意目錄,新建文件夾E:\work\code\go,cmd進入該目錄,執行 go env 查看環境配置;github
三、設置golang的GOPATH環境golang
set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\Administrator\AppData\Local\go-build set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOOS=windows set GOPATH=C:\Users\Administrator\go set GOPROXY= set GORACE= set GOROOT=C:\Go set GOTMPDIR= set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 set GCCGO=gccgo set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD= set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessag e-length=0 -fdebug-prefix-map=C:\Users\ADMINI~1\AppData\Local\Temp\go-build05377 4846=/tmp/go-build -gno-record-gcc-switches
單次配置:執行 set GOPATH=E:\work\code\goweb
永久配置GOPATH,須要在系統環境變量中新增一個GOPATH的配置項,由此能夠經過go將beego與bee的包下到該GOPATH目錄中的src目錄中來windows
四、在E:\work\code\go下執行瀏覽器
go get github.com/beego/bee
go get github.com/astaxie/beego
下載bee,下載beego
五、配置bee環境變量,將E:\work\code\go\bin配置到系統path環境變量中,用於全局使用beeapp
六、使用bee建立一個新項目ide
bee new webAppui
此時,會發如今E:\work\code\go\src目錄下會多出一個webApp的Go項目debug
七、bee run webApp
若是報以下錯誤,別慌
2018/12/26 11:18:03 WARN ▶ 0001 Running application outside of GOPATH
2018/12/26 11:18:03 INFO ▶ 0002 Using 'webApp' as 'appname'
2018/12/26 11:18:03 INFO ▶ 0003 Initializing watcher...
can't load package: package .: no Go files in E:\work\code\go\src
2018/12/26 11:18:03 ERROR ▶ 0004 Failed to build the application: can't load
package: package .: no Go files in E:\work\code\go\src
直接到webApp目錄底下,執行go run main.go
打開瀏覽器輸入 http://localhost:8080/ 能夠看到歡迎頁面