feat: scaffold Go module with version command, Makefile and goreleaser config
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
BINARY := agent-lib
|
||||
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
|
||||
LDFLAGS := -s -w -X github.com/m3tam3re/agent-lib/internal/version.Version=$(VERSION)
|
||||
|
||||
.PHONY: build test vet lint fmt fmt-check clean
|
||||
|
||||
build:
|
||||
go build -ldflags '$(LDFLAGS)' -o $(BINARY) .
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
vet:
|
||||
go vet ./...
|
||||
|
||||
fmt:
|
||||
gofmt -w .
|
||||
|
||||
fmt-check:
|
||||
@out=$$(gofmt -l .); if [ -n "$$out" ]; then \
|
||||
echo "gofmt required on:"; echo "$$out"; exit 1; fi
|
||||
|
||||
lint: vet fmt-check
|
||||
|
||||
clean:
|
||||
rm -rf $(BINARY) dist/
|
||||
Reference in New Issue
Block a user