创建分支
git checkout -b fptang
更新分支代码并提交
git add *
git commit -m "first commit"
git push origin fptang
git init
git add README.md
git commit -m
git branch -M main
git remote add origin git@github.com:tangfuping/go-oj.git
git push -u origin main
在go-oj目录下:
go mod init go-oj
安装gin
GIN中文官网:https://gin-gonic.com/zh-cn/docs/
go get -u github.com/gin-gonic/gin
安装gorm
GORM中文官网:https://gorm.io/zh_CN/docs/
go get -u gorm.io/gorm
go get -u gorm.io/driver/mysql
viper
go get github.com/spf13/viperSwagger
参考文档: https://github.com/swaggo/gin-swagger
接口访问地址:http://localhost:8080/swagger/index.html
go get -u github.com/swaggo/swag/cmd/swag
swag init