Files
Dimitri Herzog 63f8d9a91e build: upgrade Go to 1.26.2 and golangci-lint to v2.12.2 (#2062)
- Update go.mod to Go 1.26.2
- Bump golangci-lint from v2.11.3 to v2.12.2 in Makefile
- Rename gomodguard → gomodguard_v2 in .golangci.yml (v2 linter name)
- Extract repeated string literals to constants to satisfy the stricter
  goconst checks introduced by the new linter version (19 issues fixed)
2026-05-19 13:15:03 +02:00

45 lines
815 B
Go

package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
const refreshCmdName = "refresh"
// NewListsCommand creates new command instance
func NewListsCommand() *cobra.Command {
c := &cobra.Command{
Use: "lists",
Short: "lists operations",
PersistentPreRunE: initConfigPreRun,
}
c.AddCommand(newRefreshCommand())
return c
}
func newRefreshCommand() *cobra.Command {
return &cobra.Command{
Use: refreshCmdName,
Short: "refreshes all lists",
RunE: refreshList,
}
}
func refreshList(cmd *cobra.Command, _ []string) error {
client, err := newAPIClient()
if err != nil {
return err
}
resp, err := client.ListRefreshWithResponse(cmd.Context())
if err != nil {
return fmt.Errorf("can't execute %w", err)
}
return printOkOrError(resp, string(resp.Body))
}