Fix cobra cmd lint findings · Entire
Fix cobra cmd lint findings
8134d32→main·
Soph·2mo ago·4 files·+7 added/-3 removed
Add missing errors imports introduced when fmt.Errorf calls with constant strings were converted to errors.New, and silence wrapcheck on the cobra ExecuteContext boundary where the returned error is already user-facing (RunE-prefixed or cobra arg validation).
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
Sessions
a998a8395fc4View transcript
[?
[lint:go] golangci-lint has version 2.11.4 built with go1.26.1 from 8f3b0c7e on 2026-03-22T17:35:14ZClaude Code·Opus 4.7[1m]·1 step](/content/gh/entireio/git-sync/session/0cd46975-a945-4e8b-b0fa-f6cf392e38b2#timeline-a998a8395fc4/index.html)
Changes
4
cmd/git-sync
Mbootstrap.go+2/-1
Mfetch.go+2/-1
Mmain.go+1
Mprobe.go+2/-1
1
2
3
4
5
6
7
44 unmodified lines
52
53
54
54
55
56
57
58
package main
import (
"errors"
"fmt"
gitsync "entire.io/entire/git-sync"
44 unmodified lines
}
if req.Source.URL == "" || req.Target.URL == "" {
return fmt.Errorf("bootstrap requires source and target repository URLs")
return errors.New("bootstrap requires source and target repository URLs")
}
result, err := unstable.New(unstable.Options{
Mcmd/git-sync/bootstrap.go+2/-1
1
2
3
4
5
6
7
27 unmodified lines
35
36
37
37
38
39
40
41
package main
import (
"errors"
"fmt"
"strings"
27 unmodified lines
req.Source.URL = args[0]
}
if req.Source.URL == "" {
return fmt.Errorf("fetch requires a source repository URL")
return errors.New("fetch requires a source repository URL")
}
if branches != "" {
req.Scope.Branches = splitCSV(branches)
Mcmd/git-sync/fetch.go+2/-1
41 unmodified lines
42
43
44
45
46
47
48
41 unmodified lines
showUsage(target, err)
return errSilent
}
//nolint:wrapcheck // cobra surfaces errors that are already user-facing (RunE-prefixed or cobra arg validation); main prints them with an "error:" prefix
return err
}
Mcmd/git-sync/main.go+1
1
2
3
4
5
6
7
28 unmodified lines
36
37
38
38
39
40
41
42
package main
import (
"errors"
"fmt"
gitsync "entire.io/entire/git-sync"
28 unmodified lines
targetURL = args[1]
}
if req.Source.URL == "" {
return fmt.Errorf("probe requires a source repository URL")
return errors.New("probe requires a source repository URL")
}
if targetURL != "" {
req.Target = &gitsync.Endpoint{
Mcmd/git-sync/probe.go+2/-1