Scaffolding project for karriere.at GO apps
Be sure to replace all occurences of go-scaffold in:
- Readme
- Makefile
- Dockerfile
- go.mod
Update VERSION
and CHANGELOG.md
to match your settings
Change the LICENSE
file or at least update the copyright information in its
make build
- build {PROJECT} with in makefile defined OS-ARCH constellationsmake build-dev
- build {PROJECT} for OS-ARCH set by GOOS and GOARCH env variablesmake build-docker
- build {PROJECT} for linux-amd64 docker imagemake fmt
- use gofmt & goimportsmake lint
- rungolangci-lint
make test
- run go test including race detectionmake coverage
- same asmake test
and usinggo-junit-report
for report.xmlmake dist
- build and create packages with hashsumsmake docker
- creates a docker imagemake docker-release/docker-release-latest
- creates the docker image and pushes it to the registry (latest pushes also latest tag) - not fully implementedmake setup
- adds git pre-commit hooks
PROJECT
- name of the project which is been used for naming etc.VERSION
- reads content of theVERSION
fileXC_OS
- list of operating systems for cross compiling. Default:linux darwin
XC_ARCH
- list of architectures for cross compiling. Default:386 amd64 arm
- view limitationsLD_FLAGS
- build flags. Default:-X main.version=$(VERSION) -s -w
SOURCE_FILES
- used for the test command. Default:./...
TEST_PATTERN
- Default:.
TEST_OPTIONS
- Default:-v -failfast -race
TEST_TIMEOUT
- Default:2m
LINT_VERSION
- version of golangci-lint. Default:1.15.0
- if you build for darwin the archs
386
andarm
are omitted - if you build for windows the arch
arm
is omitted - building the docker container is currently only possible for linux-amd64
- The docker-release functionality is currently in implementation
- Configuration options for linter
- Configuration for docker image building
- travis-ci / circle-ci config files
Feel free to create an PR with additional functionality but please create a issue in the first place to discuss if the change should be in this repo or in a fork
- golangci-lint - linter
- go-junit-report - junit converter for jenkins reports