mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-20 15:06:36 +00:00
fix: resolve pre-existing CI failures (sora test mock, staticcheck)
- Add missing CountByStorageType method to stubSoraGenRepo test mock - Suppress SA1019 for WithCredentialsJSON (admin-controlled source) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
97343ed371
commit
2b6f3317d6
2 files changed
+4
-1
No files matched your search
@@ -124,6 +124,9 @@ func (r *stubSoraGenRepo) CountByUserAndStatus(_ context.Context, _ int64, _ []s
|
|||||||
}
|
}
|
||||||
return r.countValue, nil
|
return r.countValue, nil
|
||||||
}
|
}
|
||||||
|
func (r *stubSoraGenRepo) CountByStorageType(_ context.Context, _ string, _ []string) (int64, error) {
|
||||||
|
return 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
// ==================== 辅助函数 ====================
|
// ==================== 辅助函数 ====================
|
||||||
|
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ func (s *SoraGDriveStorage) buildOAuth2Service(ctx context.Context, profile *Sor
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *SoraGDriveStorage) buildServiceAccountService(ctx context.Context, profile *SoraS3Profile) (*drive.Service, error) {
|
func (s *SoraGDriveStorage) buildServiceAccountService(ctx context.Context, profile *SoraS3Profile) (*drive.Service, error) {
|
||||||
srv, err := drive.NewService(ctx, option.WithCredentialsJSON([]byte(profile.ServiceAccountJSON)))
|
srv, err := drive.NewService(ctx, option.WithCredentialsJSON([]byte(profile.ServiceAccountJSON))) //nolint:staticcheck // SA1019: admin-controlled service account JSON, safe to use
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("create gdrive service account service: %w", err)
|
return nil, fmt.Errorf("create gdrive service account service: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user