fix: resolve all golangci-lint errors (#699)
Fix 12 linting issues that were causing CI failures:
errcheck (8 fixes):
- cmd/bd/mol_burn.go: wrap wispStore.Close() in defer func
- cmd/bd/mol_burn.go: handle fmt.Scanln() return value
- cmd/bd/mol_squash.go: wrap wispStore.Close() in defer func (2 locations)
- cmd/bd/wisp.go: wrap wispStore.Close() in defer func (3 locations)
- internal/beads/beads.go: wrap mainStore.Close() and wispStore.Close()
gosec G104 (2 fixes):
- internal/storage/sqlite/multirepo.go: handle rows.Close() errors
misspell (1 fix):
- cmd/bd/mol_burn.go: change "Cancelled" to "Canceled"
unparam (1 fix):
- cmd/bd/mol_squash.go: use blank identifier for unused cmd parameter
All fixes follow existing patterns in the codebase:
- defer func() { _ = store.Close() }() for deferred closes
- _ = rows.Close() for explicit closes with ignored errors
- _, _ = fmt.Scanln() for ignored return values
Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
This commit is contained in:
@@ -216,7 +216,7 @@ func runWispCreate(cmd *cobra.Command, args []string) {
|
||||
fmt.Fprintf(os.Stderr, "Error: failed to open wisp storage: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer wispStore.Close()
|
||||
defer func() { _ = wispStore.Close() }()
|
||||
|
||||
// Ensure wisp directory is gitignored
|
||||
if err := beads.EnsureWispGitignore(); err != nil {
|
||||
@@ -358,7 +358,7 @@ func runWispList(cmd *cobra.Command, args []string) {
|
||||
}
|
||||
return
|
||||
}
|
||||
defer wispStore.Close()
|
||||
defer func() { _ = wispStore.Close() }()
|
||||
|
||||
// List all issues from wisp storage
|
||||
issues, err := listWispIssues(ctx, wispStore, showAll)
|
||||
@@ -597,7 +597,7 @@ func runWispGC(cmd *cobra.Command, args []string) {
|
||||
fmt.Fprintf(os.Stderr, "Error opening wisp storage: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer wispStore.Close()
|
||||
defer func() { _ = wispStore.Close() }()
|
||||
|
||||
// Get all issues from wisp storage
|
||||
filter := types.IssueFilter{}
|
||||
|
||||
Reference in New Issue
Block a user