go mod init gitlab.com/alansuparlan/golang-gin
go run server.go
go get -u github.com/swaggo/swag/cmd/swag
swag init
setelah nanti di masuk Swagger Ui masukan jwt token diawali dengan Bearer
docker build --tag alansuparlan/golang-gin .
docker run -p 5000:5000 alansuparlan/golang-gin
docker login
docker push alansuparlan/golang-gin
Golang clean-architecture codebase example containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
make
./go-realworld-clean
Start the server with an existing user
./go-realworld-clean --populate=true
In another terminal, run the tests against the API
newman run api/Conduit.postman_collection.json \
-e api/Conduit.postman_integration_test_environment.json \
--global-var "[email protected]" \
--global-var "PASSWORD=password"
The version is either 0.1.0
if no tag has ever been defined or the latest
tag defined. The build number is the SHA1 of the latest commit.
- make: Builds and injects version/build in binary
- make init: Sets the pre-commit hook in the repository
- make docker: Build docker image and tag it with both
latest
and version - make latest: Build docker image and tag it only with
latest
- make test: Executes the test suite
- make mock: Generate the necessary mocks
- make clean: Removes the built binary if present