diff --git a/.golangci.yml b/.golangci.yml index 8803b58..7689647 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -117,6 +117,7 @@ linters: - wsl_v5 # whitespace v5 - zerologlint # zerolog 检查 + linters: exclusions: rules: - path: '_test\.go' @@ -127,6 +128,11 @@ linters: - path: 'internal/ssl/ocsp_test\.go' linters: - unparam + # 排除 revive 的 stuttering 检查(lua.LuaXxx 类型命名) + - path: 'internal/lua/' + text: "stutters" + linters: + - revive formatters: default: all @@ -153,4 +159,9 @@ linters-settings: rules: - name: unused-parameter severity: warning - disabled: false \ No newline at end of file + disabled: false + - name: exported + severity: warning + disabled: false + arguments: + - "disableStutteringCheck" \ No newline at end of file diff --git a/Makefile b/Makefile index 2305c8c..7b86659 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ BUILD_DIR := bin # 静态构建(禁用 CGO) CGO_DISABLE := CGO_ENABLED=0 -# 生产构建标志(体积优化) +# 生产构建标志 LDFLAGS := -ldflags "-s -w \ -X 'rua.plus/lolly/internal/app.Version=$(VERSION)' \ -X 'rua.plus/lolly/internal/app.GitCommit=$(GIT_COMMIT)' \ @@ -36,23 +36,8 @@ MAIN_PATH := main.go # 构建命令 # ============================================ -# 本地构建(静态链接) -build: - @echo "Building $(APP_NAME) (static)..." - @mkdir -p $(BUILD_DIR) - $(CGO_DISABLE) go build $(LDFLAGS) -o $(BUILD_DIR)/$(APP_NAME) $(MAIN_PATH) - @echo "Built: $(BUILD_DIR)/$(APP_NAME)" - @echo "Version: $(VERSION) | Commit: $(GIT_COMMIT) | Platform: $(BUILD_PLATFORM)" - -# 生产构建(体积优化,静态链接) -# build-size: -# @echo "Building $(APP_NAME) for production (static)..." -# @mkdir -p $(BUILD_DIR) -# $(CGO_DISABLE) go build $(LDFLAGS) -trimpath -o $(BUILD_DIR)/$(APP_NAME) $(MAIN_PATH) -# @echo "Production build complete: $(BUILD_DIR)/$(APP_NAME)" - # 生产构建(最大运行时性能,静态链接) -build-prod: +build: @echo "Building $(APP_NAME) with max runtime performance (static)..." @mkdir -p $(BUILD_DIR) $(CGO_DISABLE) go build $(LDFLAGS) $(PERF_GCFLAGS) $(PERF_ASMFLAGS) -trimpath \