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
取決於您是否想查看測試覆蓋範圍以及您想要的輸出的冗長。