Fix lint errors and bump golangci-lint to v2/action v9
CI / Test (linux/amd64) (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Cross-build (darwin/amd64) (push) Waiting to run
CI / Cross-build (linux/amd64) (push) Waiting to run
CI / Cross-build (darwin/arm64) (push) Waiting to run
CI / Cross-build (linux/arm64) (push) Waiting to run

- Migrate .golangci.yml to golangci-lint v2 config format
- Bump golangci-lint-action from v6 (Node 20, deprecated) to v9 (Node 24)
- Fix errcheck: check fmt.Fscanln and fmt.Sscanf return values
- Fix ineffassign: replace unused vars with _ in test files
- Fix revive unused-parameter: rename unused cmd/args/r/c params to _
- Fix revive empty-block: invert if condition in push command
- Fix revive redefines-builtin-id: rename 'clear' to 'clearsigned'
- Fix revive blank-imports: add comment on modernc.org/sqlite import
- Fix unused: remove unused 'suite' and 'gen' fields from cache entry
This commit is contained in:
2026-06-28 17:07:50 -05:00
parent f7ccf67b8a
commit c5e64cf63f
19 changed files with 84 additions and 71 deletions
+6 -8
View File
@@ -18,7 +18,7 @@ func (r *Root) pushCmd() *cobra.Command {
Use: "push <repo> <distro> <component> <file.deb>",
Short: "Upload a .deb package to a repository",
Args: cobra.ExactArgs(4),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
repo, dist, component, file := args[0], args[1], args[2], args[3]
// Local pre-validation for early, clear errors.
@@ -31,9 +31,7 @@ func (r *Root) pushCmd() *cobra.Command {
if archOverride != "" {
arch = archOverride
}
if r.flagJSON {
// no-op: keep flag accepted
} else {
if !r.flagJSON {
fmt.Printf("Pushing %s_%s_%s (%d bytes)\n", pkgName, ver, arch, inspected.Size)
}
@@ -66,7 +64,7 @@ func (r *Root) lsCmd() *cobra.Command {
Use: "ls <repo> <distro>",
Short: "List packages in a repository/distribution",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
c, err := r.client()
if err != nil {
return err
@@ -106,7 +104,7 @@ func (r *Root) showCmd() *cobra.Command {
Use: "show <repo> <id|name[@version][:arch]>",
Short: "Show package metadata",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
c, err := r.client()
if err != nil {
return err
@@ -137,7 +135,7 @@ func (r *Root) pullCmd() *cobra.Command {
Use: "pull <repo> <id|name[@version][:arch]>",
Short: "Download a package's .deb file",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
c, err := r.client()
if err != nil {
return err
@@ -174,7 +172,7 @@ func (r *Root) rmCmd() *cobra.Command {
Use: "rm <repo> <id|name[@version][:arch]>",
Short: "Delete a package",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
c, err := r.client()
if err != nil {
return err