VERSION := 1.0.0 GIT_COMMIT := $(shell git rev-parse HEAD) LDFLAGS := -X 'git.eeqj.de/sneak/smartconfig.Version=$(VERSION)' -X 'git.eeqj.de/sneak/smartconfig.GitCommit=$(GIT_COMMIT)' .PHONY: test lint check-fmt fmt build test: lint check-fmt go test -v ./... lint: golangci-lint run check-fmt: @if [ -n "$$(gofmt -l .)" ]; then \ echo "Go code is not formatted:"; \ gofmt -l .; \ exit 1; \ fi fmt: go fmt ./... build: go build -ldflags "$(LDFLAGS)" -o smartconfig ./cmd/smartconfig