From eaa1412bcbae8d52678f9ef3b333cf59e0159cad Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Thu, 4 Dec 2025 23:20:47 +0800 Subject: [PATCH] build: ensure Go init runs before binary compilation --- account/Makefile | 2 +- go.mod | 2 +- rag-server/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/account/Makefile b/account/Makefile index f30f917..a633bb0 100644 --- a/account/Makefile +++ b/account/Makefile @@ -266,7 +266,7 @@ create-super-admin: # ⚙️ 编译与运行 # ========================================= -build: +build: init-go @go build -o $(APP_NAME) $(MAIN_FILE) upgrade: build diff --git a/go.mod b/go.mod index db9d617..f555d79 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/gin-contrib/cors v1.6.0 github.com/gin-gonic/gin v1.9.1 github.com/go-git/go-git/v5 v5.16.2 + github.com/golang-jwt/jwt/v5 v5.3.0 github.com/golang-migrate/migrate/v4 v4.19.0 github.com/google/uuid v1.6.0 github.com/jackc/pgx/v5 v5.7.5 @@ -46,7 +47,6 @@ require ( github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.19.0 // indirect github.com/goccy/go-json v0.10.2 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect diff --git a/rag-server/Makefile b/rag-server/Makefile index 5d8f7f4..c2bbd64 100644 --- a/rag-server/Makefile +++ b/rag-server/Makefile @@ -42,7 +42,7 @@ init: @echo ">>> 可选安装 air (开发热重载)" @echo "如需安装,请运行: go install github.com/air-verse/air@latest" -build: +build: init @echo ">>> 编译 $(APP_NAME)" go build -o $(APP_NAME) $(MAIN_FILE)