快速开始api开发(一)项目初始化
本文需要介绍 gotools 工具
需要使用的工具命令:
gotools init -h
代码地址:github.com/wuyan94zl/gotools
项目结构
创建项目: mkdir example-api
&& cd example-api
执行: gotools init --package github.com/wuyan94zl/example-api
生成项目目录结构
项目文件结构
config
|-- config.go
container
|-- conn.go
|-- kernal.go
|-- container.go
router
|-- route.go
main.go
config.yaml
启动运行
执行:go run main.go
下一篇,基于gorm+mysql 生成model,并依赖注入到container
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: