feat: scaffold Go module with version command, Makefile and goreleaser config

This commit is contained in:
2026-08-22 21:41:05 +02:00
parent 8d34426864
commit 2a6498dae1
7 changed files with 163 additions and 0 deletions
+26
View File
@@ -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/