This is a simple Go project structure with Gin framework and Swagger documentation.
go run cmd/server/main.go
http://127.0.0.1:4000/swagger/index.html#/
swag init --parseDependency --parseInternal -g cmd/server/main.go
docker compose up -d
sqlc generate
go test ./test/server_test.go
docker run --name sonarqube \
-p 9000:9000 \
sonarqube:latest
go test -coverpkg=./... -coverprofile=coverage.out ./test
go test ./... -json > report.json
go tool cover -func=coverage.out
sonar-scanner \
-Dsonar.projectKey=go-simple \
-Dsonar.sources=. \
-Dsonar.host.url=http://127.0.0.1:9000 \
-Dsonar.token=sqp_XXXX
export SONAR_HOST_URL=http://your-sonarqube-server.com
export SONAR_TOKEN=your-sonar-token-here
docker compose up
go run cmd/server/main.go
protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative --grpc-gateway_out=. --grpc-gateway_opt=paths=source_relative api/proto/product/v1/product.proto
go get google.golang.org/grpc
go get -tool github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
go get -tool github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
go get -tool google.golang.org/protobuf/cmd/protoc-gen-go
go get -tool google.golang.org/grpc/cmd/protoc-gen-go-grpc
npm install -g @liara/cli
liara login
liara deploy