go环境配置
简介:
go环境配置
安装 go gin
go env -w GO111MODULE=auto
go env -w GOPROXY=https://goproxy.cn,direct
go get -u http://github.com/gin-gonic/gin
创建 %GOPATH%/src/golang.org/x/
cd %GOPATH%/src/golang.org/x/
git clone git@github.com:golang/net|crypto|sync|text.git
创建 %GOPATH%/src/google.golang.org
git clone https://github.com/protocolbuffers/protobuf-go.git 重命名 protobuf
主文件代码:
main.go
package main
import (
"github.com/gin-gonic/gin"
"net/http"
)
func main() {
router := gin.Default()
router.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Hello World")
})
router.Run(":8000")
}

上一篇: laravel 项目从github仓库拉取加载类库
下一篇: PHP将中文字符串转换为数字