Git Product home page Git Product logo

go-gin-skeleton's Introduction

go-gin-skeleton

使用golang gin框架的应用骨架

包含应用

  • api API接口应用
  • cli CLI命令行应用
  • web web应用

使用的包

辅助库

  • dep 使用dep来安装管理依赖库
  • swagger 文档生成:可以使用go-swagger 或者 swaggo/swag
  • stretchr/testify 测试辅助库,方便快速断言 stretchr/testify
    • 常用的是它的断言包 github.com/stretchr/testify/assert

额外组件

  • swagger UI: swagger文档渲染
  • Dockerfile: 可用于生产环境的docker镜像构建脚本,基于alpine,构建完成一个项目镜像估计大小为:30 M 左右
  • makefile: 已经内置一些快速使用的make命令,帮助快速生成文档,构建镜像

开始使用

  • 首先,将骨架clone到 GOPATH 的 src下,重命名 go-gin-skeleton 目录为你的项目名
  • 进入到项目,将项目中 github.com/inhere/go-gin-skeleton 替换为你的项目名(针对go文件)
  • 再搜索将所有的go-gin-skeleton替换为你的项目名(主要是Dockerfile,makefile里)
  • 运行 dep ensure 安装依赖库到vendor
  • 运行项目:go run main.go

使用帮助

  • 运行测试
go test
// 输出覆盖率
go test -cover
  • 格式化项目
go fmt ./...
  • 运行GoLint检查

需先安装 GoLint

golint ./...

License

MIT

go-gin-skeleton's People

Contributors

inhere avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.