Init: bootstrap go module with basic framework

This commit is contained in:
2025-09-25 08:14:34 +08:00
commit 60f534be1e
47 changed files with 1084 additions and 0 deletions

27
Makefile Normal file
View File

@@ -0,0 +1,27 @@
.PHONY: all swagger docker install test sh
SWAG ?= ~/go/bin/swag
GO_ENV += CGO_ENABLED=0
TARGET := $(shell find . -type f -name '*.go')
all: swagger docker install
docker: amane
docker compose up -d --force-recreate --build backend
install:
$(GO_ENV) go install
test:
go test -v ./tests/units
swagger:
$(SWAG) fmt
$(SWAG) init -o handlers/docs -g cmd/backend.go -pdl 1
amane: $(TARGET)
$(GO_ENV) go build -o $@
sh:
docker compose exec -it backend sh