mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 15:06:37 +08:00
refactor: revive cleanup — unused params to _, add missing doc comments
- admin/db_helper GetCache/GetUserService/GetAuthService: ctx -> _ (签名对称保留) - validateMergedStorageConfig / ParseMigrationTargetConfig / MockStorageService.Put 未用参数 -> _ - SetDBServiceForTest、StorageDriver 常量组补充文档注释 lint_issues 33→26
This commit is contained in:
@@ -113,22 +113,25 @@ func GetDB(ctx context.Context) *gorm.DB {
|
||||
return dbService.DB(ctx)
|
||||
}
|
||||
|
||||
// GetCache returns the unified CacheService instance.
|
||||
func GetCache(ctx context.Context) contracts.CacheService {
|
||||
// GetCache returns the unified CacheService instance. ctx is kept for
|
||||
// signature symmetry with the other context-aware accessors.
|
||||
func GetCache(_ context.Context) contracts.CacheService {
|
||||
servicesMu.RLock()
|
||||
defer servicesMu.RUnlock()
|
||||
return cacheService
|
||||
}
|
||||
|
||||
// GetUserService returns the UserService instance.
|
||||
func GetUserService(ctx context.Context) contracts.UserService {
|
||||
// GetUserService returns the UserService instance. ctx is kept for
|
||||
// signature symmetry with the other context-aware accessors.
|
||||
func GetUserService(_ context.Context) contracts.UserService {
|
||||
servicesMu.RLock()
|
||||
defer servicesMu.RUnlock()
|
||||
return userService
|
||||
}
|
||||
|
||||
// GetAuthService returns the AuthService instance.
|
||||
func GetAuthService(ctx context.Context) contracts.AuthService {
|
||||
// GetAuthService returns the AuthService instance. ctx is kept for
|
||||
// signature symmetry with the other context-aware accessors.
|
||||
func GetAuthService(_ context.Context) contracts.AuthService {
|
||||
servicesMu.RLock()
|
||||
defer servicesMu.RUnlock()
|
||||
return authService
|
||||
|
||||
@@ -507,7 +507,7 @@ func validateAndMergeStorageConfig(ctx context.Context, value, currentConfig str
|
||||
return string(unmaskedVal), nil
|
||||
}
|
||||
|
||||
func validateMergedStorageConfig(ctx context.Context, currentCfg, newCfg, targetCfg contracts.StorageConfigDTO) error {
|
||||
func validateMergedStorageConfig(ctx context.Context, currentCfg, newCfg, _ contracts.StorageConfigDTO) error {
|
||||
if newCfg.Driver != "" && newCfg.Driver != currentCfg.Driver {
|
||||
var uploadCount int64
|
||||
gormDB := GetDB(ctx)
|
||||
|
||||
Reference in New Issue
Block a user