Messaging service, adapters, refactoring

This commit is contained in:
2023-12-07 09:00:30 +03:00
parent cf00cfaab6
commit 08a7c9c04f
18 changed files with 623 additions and 53 deletions

21
Makefile Normal file
View File

@@ -0,0 +1,21 @@
BIN_PATH:=./bin
CMD_PATH:=./cmd/server/main.go
LAST_COMMIT:=$(shell git rev-list --abbrev-commit --all --max-count=1)
TAG:=$(shell git describe --abbrev=0 --tags ${LAST_COMMIT} 2>/dev/null || true)
VERSION:=$(or $(TAG:v%=%),0.0.0)-$(LAST_COMMIT)
LDFLAGS=-extldflags=-static -w -s -w -s -X main.version=${VERSION}
.PHONY: build test lint
all: lint test build
build:
CGO_ENABLED=0 go build -ldflags='${LDFLAGS}' -o ${BIN_PATH}/service ./cmd/server/main.go
test:
go test -v -race ./...
lint:
@which golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run -j4 ./...