# GO改进版 **Repository Path**: lps0798/go-improved-version ## Basic Information - **Project Name**: GO改进版 - **Description**: GO改进版 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-11-10 - **Last Updated**: 2023-11-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README go + mysql 进行后端 crud 的编写 1. 安装 go 的环境 https://www.runoob.com/go/go-environment.html 2. 安装 数据库 mysql 3. 安装一个测试工具 , postman / apipost 4. golang / vscode 5. navicat https://www.kancloud.cn/shuangdeyu/gin_book/949412 https://gorm.io/zh_CN/docs/ https://www.kancloud.cn/shuangdeyu/gin_book/949416 https://github.com/yanmiao99/vue3-go-crud-project 1. go mod init 创建项目的文件名 go mod tidy 2. 创建一个 main.go 文件 安装依赖: 安装Gin包:go get -u github.com/gin-gonic/gin * 安装GORM包: go get -u gorm.io/gorm * go get -u gorm.io/driver/sqlite 两个选择其中一个就可以 安装MySQL驱动包:go get -u gorm.io/driver/mysql * 安装MySQL驱动包:go get -u github.com/go-sql-driver/mysql * 安装日志Log包:go get -u github.com/sirupsen/logrus * go get -u github.com/lestrrat-go/file-rotatelogs * go get -u github.com/rifflock/lfshook * 安装数据存储缓存go-redis包:go get -u github.com/go-redis/redis/v8 安装验证码base64Captcha包:go get -u github.com/mojocn/ase64Captcha 安装权限认证jwt-go包:go get -u github.com/dgrijalva/jwt-go 安装yaml包: go get -u gopkg.in/yaml.v3 * 安装获取客户端OS和browser包:go get -u github.com/wenlng/go-user-agent * 安装获取客户端IP地址包:go get -u github.com/gin-contrib/location 安装IP地址包:go get -u github.com/gogf/gf * 安装swagger包: go get -u github.com/swaggo/files * go get -u github.com/swaggo/gin-swagger * go get -u github.com/swaggo/swag/cmd/swag go install github.com/swaggo/swag/cmd/swag@latest * swag init * http://localhost:8888/swagger/index.html go get -u github.com/gin-contrib/cors * go get -u github.com/spf13/viper * go get -u gopkg.in/natefinch/lumberjack.v2 * 2023-11-04 10:36:16.566