```shell # https://gin-gonic.com/zh-cn/docs/quickstart/ go get -u github.com/gin-gonic/gin # https://github.com/swaggo/gin-swagger go install github.com/swaggo/swag/cmd/swag@latest swag init go get -u github.com/swaggo/gin-swagger go get -u github.com/swaggo/files ``` ```shell # [link](https://github.com/oapi-codegen/oapi-codegen/?tab=readme-ov-file) # this will then modify your `go.mod` go get -tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest #go:generate go tool oapi-codegen -config cfg.yaml ../../api.yaml go tool oapi-codegen -config cfg.yaml api.yaml ``` ```shell # https://go-lang.org.cn/doc/tutorial/govulncheck go install golang.org/x/vuln/cmd/govulncheck@latest govulncheck ./... go install github.com/magefile/mage@latest mage -init mage build ``` ```go //go:build mage package main import ( "github.com/magefile/mage/sh" ) // Runs go mod download and then installs the binary. func Build() error { if err := sh.Run("go", "mod", "download"); err != nil { return err } return sh.Run("go", "install", "./...") } ``` ```json // on vscode settings.json { "gopls": { "buildFlags": ["-tags=mage"] } } ```