Go Shop

Master codecov GitHub go.mod Go version GitHub

An example of gin contains many useful features for e-commerce websites

How to run

Required Environment

You can see the docker compose file here to set up required environment

Config

environment: production
http_port: 8888
grpc_port: 8889
auth_secret: ######
database_uri: postgres://username:password@host:5432/database
redis_uri: localhost:6379
redis_password:
redis_db: 0

Run

$ go run cmd/api/main.go 
2023-09-12T15:18:36.684+0700    INFO    http/server.go:58       HTTP server is listening on PORT: 8888
2023-09-12T15:18:36.684+0700    INFO    grpc/server.go:53       GRPC server is listening on PORT: 8889

Test

$ go test

Test with Coverage

go test -timeout 9000s -a -v -coverprofile=coverage.out -coverpkg=./... ./...

or

make unittest

Document

Tech stack

What's next?

Donate: