Skip to content

Commit 376c0b1

Browse files
William Caiclaude
andcommitted
Fix Go 1.25 format string errors
## Issue Go 1.25 has stricter format string checks, causing build failures: - errors.Wrapf requires ErrorCode as second parameter - log.Printf requires format string ## Changes - pkg/store/file/fileStore.go: Added missing errors.StoreError codes (2 locations) - pkg/store/file/fileStore_test.go: Fixed log.Printf to use format string ## Test Results ✅ pkg/cfg - PASS ✅ pkg/eval - PASS (including fixed certificate tests) ✅ pkg/store/file - PASS ✅ pkg/store/etcd - PASS ❌ pkg/store/mongodb - FAIL (expected: no MongoDB server available) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 9af6045 commit 376c0b1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/store/file/fileStore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ func (s *Store) GetPolicyAndRolePolicyCounts() (map[string]*pms.PolicyAndRolePol
145145

146146
policyCount, err := s.getPolicyCountWithoutLock(srvName)
147147
if err != nil {
148-
return nil, errors.Wrapf(err, "failed to get policy count for service: %s", srvName)
148+
return nil, errors.Wrapf(err, errors.StoreError, "failed to get policy count for service: %s", srvName)
149149
}
150150
counts.PolicyCount = policyCount
151151

152152
rolePolicyCount, err := s.getRolePolicyCountWithoutLock(srvName)
153153
if err != nil {
154-
return nil, errors.Wrapf(err, "failed to get rolePolicy count for service: %s", srvName)
154+
return nil, errors.Wrapf(err, errors.StoreError, "failed to get rolePolicy count for service: %s", srvName)
155155
}
156156
counts.RolePolicyCount = rolePolicyCount
157157

pkg/store/file/fileStore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func TestWriteReadPolicyStore(t *testing.T) {
5959
t.Error("should have 10 services in the store")
6060
}
6161
for _, service := range psr.Services {
62-
log.Printf(service.Name)
62+
log.Printf("%s", service.Name)
6363
}
6464

6565
}

0 commit comments

Comments
 (0)