golang gin realworld example app
1.0.0

golang/gin代码库包含遵守Realworld Spec和API的真实世界示例(CRUD,AUTH,ADVANDACT模式等)。
该代码库的创建是为了演示由Golang/Gin构建的完全刚刚起步的Fullstack应用程序,包括Crud操作,身份验证,路由,分页等。
.
├── gorm.db
├── hello.go
├── common
│ ├── utils.go //small tools function
│ └── database.go //DB connect manager
├── users
| ├── models.go //data models define & DB operation
| ├── serializers.go //response computing & format
| ├── routers.go //business logic & router binding
| ├── middlewares.go //put the before & after logic of handle request
| └── validators.go //form/json checker
├── ...
...
确保已安装1.13或更高。
https://golang.org/doc/install
根据最新指南设置标准GO环境变量(请参阅https://golang.org/doc/install#install)。
从项目root中,运行:
go build ./...
go test ./...
go mod tidy
从项目root中,运行:
go test ./...
或者
go test ./... -cover
或者
go test -v ./... -cover
取决于您是否想查看测试覆盖范围以及您想要的输出的冗长。