chore(lint): unify formatting on golangci-lint fmt (gofumpt), uncap issue reporting, fix gofumpt drift

- make format 现在与 code-check 使用同一格式化器(golangci-lint fmt),消除 goimports -local 与 gofumpt 的格式拉锯
- .golangci.yml 关闭默认 50/3 截断,完整上报所有问题(只增强不弱化)
- 全库 gofumpt 规范化(203 files, 纯格式无行为变更)
This commit is contained in:
ryan
2026-08-28 16:31:53 +08:00
parent 078ad9b2f3
commit 528240026d
204 changed files with 572 additions and 718 deletions
@@ -7,8 +7,8 @@ package shared
const (
MaxUploadSize = 32 * 1024 * 1024 // 32MB
DetectContentBytes = 512 // http.DetectContentType 需要的最小字节数
UploadDirPerm = 0755 // 上传目录权限
UploadFilePerm = 0644 // 上传文件权限
UploadDirPerm = 0o755 // 上传目录权限
UploadFilePerm = 0o644 // 上传文件权限
ImageQualityLow = "low"
ImageQualityMedium = "medium"
ImageQualityHigh = "high"
@@ -4,13 +4,12 @@
package shared
import (
"Wavelet/core"
"Wavelet/core/contracts"
"context"
"sync"
"gorm.io/gorm"
"Wavelet/core"
"Wavelet/core/contracts"
)
var (
@@ -4,6 +4,8 @@
package shared
import (
"Wavelet/core/contracts"
"Wavelet/pkg/testhelper"
"bytes"
"context"
"crypto/sha256"
@@ -20,9 +22,6 @@ import (
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"Wavelet/core/contracts"
"Wavelet/pkg/testhelper"
)
// MockDBService is a mock implementation of contracts.DBService for unit testing.
@@ -130,8 +129,8 @@ func (m *MockStorageService) Put(_ context.Context, key string, body io.Reader,
}
m.objects[key] = data
if strings.HasPrefix(key, "uploads/") {
_ = os.MkdirAll(filepath.Dir(key), 0755)
_ = os.WriteFile(key, data, 0644)
_ = os.MkdirAll(filepath.Dir(key), 0o755)
_ = os.WriteFile(key, data, 0o644)
}
return contracts.StoragePutResult{Key: key, Bucket: "test-bucket"}, nil
}
@@ -234,7 +233,7 @@ func (a *MockAuthService) VerifyToken(_ context.Context, token string) (*contrac
}
// Authenticate verifies credentials.
func (a *MockAuthService) Authenticate(_ context.Context, _ string, _ string) (*contracts.UserDTO, error) {
func (a *MockAuthService) Authenticate(_ context.Context, _, _ string) (*contracts.UserDTO, error) {
return nil, nil
}