fix: resolve all golangci-lint errors
Fixes 15 pre-existing lint issues: errcheck (6 issues): - mol_distill.go: Add _ = for f.Close() and os.Remove() - routed.go: Add _ = for routedStorage.Close() (4 locations) gosec (8 issues): - maintenance.go, routes.go: Add nolint for G304 (file paths from known dirs) - mol_distill.go: Add nolint for G304 (file creation in known search paths) - formula.go: Change WriteFile permissions from 0644 to 0600 (G306) - gate.go: Add nolint for G204 (exec.Command with trusted AwaitID fields) misspell (1 issue): - gate.go: Fix "cancelled" -> "canceled" in comment unparam (2 issues): - cook.go, controlflow.go: Add nolint for functions returning always-nil error Also: - Update pre-commit-hooks to v6.0.0 - Add lint step to "Landing the Plane" session-end protocol
This commit is contained in:
@@ -50,14 +50,14 @@ func resolveAndGetIssueWithRouting(ctx context.Context, localStore storage.Stora
|
||||
// Step 2: Resolve and get from routed store
|
||||
result, err := resolveAndGetFromStore(ctx, routedStorage.Storage, id, true)
|
||||
if err != nil {
|
||||
routedStorage.Close()
|
||||
_ = routedStorage.Close()
|
||||
return nil, err
|
||||
}
|
||||
if result != nil {
|
||||
result.closeFn = func() { routedStorage.Close() }
|
||||
result.closeFn = func() { _ = routedStorage.Close() }
|
||||
return result, nil
|
||||
}
|
||||
routedStorage.Close()
|
||||
_ = routedStorage.Close()
|
||||
}
|
||||
|
||||
// Step 3: Fall back to local store
|
||||
@@ -133,7 +133,7 @@ func getIssueWithRouting(ctx context.Context, localStore storage.Storage, id str
|
||||
// Step 3: Try the routed storage
|
||||
routedIssue, routedErr := routedStorage.Storage.GetIssue(ctx, id)
|
||||
if routedErr != nil || routedIssue == nil {
|
||||
routedStorage.Close()
|
||||
_ = routedStorage.Close()
|
||||
// Return the original error if routing also failed
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -148,7 +148,7 @@ func getIssueWithRouting(ctx context.Context, localStore storage.Storage, id str
|
||||
Routed: true,
|
||||
ResolvedID: id,
|
||||
closeFn: func() {
|
||||
routedStorage.Close()
|
||||
_ = routedStorage.Close()
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user