操作的例子:把 ginscaffold改名为 admback
一,给项目文件夹改名:
liuhongdi@lhdpc:/data/go$ cp -axv ginscaffold/ admback
说明:刘宏缔的go森林是一个专注golang的博客,
地址:刘宏缔的go森林_老刘你真牛_CSDN博客
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,用goland打开项目
如图:
1,修改项目名字:
选中项目->右键->Refactor->Rename
在弹出的菜单中选择 Rename Project
修改为 admback
然后点 OK 按钮
2,修改包名
在项目上右击->Replace in Files
如图:把ginscaffold替换成admback
点 Replace All 按钮
三,测试打包
liuhongdi@lhdpc:/data/go/admback$ go build
liuhongdi@lhdpc:/data/go/admback$ ./admback
setting:
&{debug 8000 60ns 60ns}
&{mysql root rootpassword 127.0.0.1:3306 dig utf8 true 10 30}
&{/data/gologs/logs info warn log}
&{/data/gologs/logs access log}
modelPath:/data/go/admback/config/rbac_model.conf
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET /static/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (7 handlers)
[GIN-debug] HEAD /static/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (7 handlers)
…
四,查看go的版本
liuhongdi@lhdpc:/data/go/admback$ go version
go version go1.16.4 linux/amd64