card-service-go

module
v0.0.0-...-7555876 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2024 License: Apache-2.0

README

CI codecov

Card-Manager in Go

Web application that help you to manage your card collection.

Requirements

  • go version >= 1.22

Run locally

Run go run cmd/main.go to start the web application with the default configuration file (configs/application.yaml).

Flags:

Flag Usage Default Value Description
-c,--config -c configs/application-prod.yaml configs/application.yaml path to the configuration file

Test

  • Run all tests with go test -v ./...
  • Run unit tests go test -v -short ./...
  • Run integration tests go test -v -run Integration ./...

Integration tests require docker to be installed.

Build

Build it with go build -o card-service cmd/main.go

Dependencies

Update all dependencies with go get -u ./.... Run go mod tidy afterwards to update and cleanup the go.mod file. For mor information check: https://github.com/golang/go/wiki/Modules#how-to-upgrade-and-downgrade-dependencies

Misc

Docker linting

The linter Hadolint can be used to apply best practice on your Dockerfile.

Just run docker run --pull always --rm -i hadolint/hadolint < Dockerfile to check your Dockerfile.

Golang linting

The lint aggregator golangci-lint can be used to apply best practice and find errors in your golang code.

Just run docker run --pull always --rm -v $(pwd):/app -w /app golangci/golangci-lint:latest golangci-lint run -v inside the root dir of the project to start the linting process.

TODOs

  • try testify suite

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL