BINARY_NAME=gotography-web
BUILD_DIRECTROY=./dist

CGO_ENABLED=0

build:
	mkdir -p ${BUILD_DIRECTROY}
	CGO_ENABLED=${CGO_ENABLED} go build -ldflags "-s -w" -trimpath -o ${BUILD_DIRECTROY}/${BINARY_NAME} main.go

test: lint
	go clean -testcache
	go test ./...

test_coverage: lint
	go clean -testcache
	go test ./... -coverprofile=coverage.out

lint:
	if command -v go-staticcheck; then \
		go-staticcheck ./...; \
	else \
		staticcheck ./...; \
	fi;
