Skip to content

Commit

Permalink
lint: clean up linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gene-redpanda committed Oct 1, 2024
1 parent 586e187 commit cf4635d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/go/rpk/pkg/cli/cluster/storage/cancel-mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ Cancel a mount/unmount operation
adm, err := adminapi.NewClient(fs, pf)
out.MaybeDie(err, "unable to initialize admin client: %v", err)

migrationId, err := strconv.Atoi(from[0])
migrationID, err := strconv.Atoi(from[0])
out.MaybeDie(err, "invalid migration ID: %v", err)

err = adm.ExecuteMigration(cmd.Context(), migrationId, rpadmin.MigrationActionCancel)
err = adm.ExecuteMigration(cmd.Context(), migrationID, rpadmin.MigrationActionCancel)
out.MaybeDie(err, "unable to cancel the migration: %v", err)
},
}
Expand Down
4 changes: 2 additions & 2 deletions src/go/rpk/pkg/cli/cluster/storage/list-mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Use filter to list only migrations in a specific state
rpk cluster storage list-mount --filter planned
`,
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, from []string) {
Run: func(cmd *cobra.Command, _ []string) {
pf, err := p.LoadVirtualProfile(fs)
out.MaybeDie(err, "rpk unable to load config: %v", err)
config.CheckExitCloudAdmin(pf)
Expand Down Expand Up @@ -135,7 +135,7 @@ func rpadminMigrationStateToMigrationState(in []rpadmin.MigrationState) (resp []

// rpadminTopicsToStringSlice converts a slice of rpadmin.NamespacedTopic to a slice of strings
// if the topic has a non nil namespace it will appear as `namespace:topic`
// otherwise it will appear as `topic`
// otherwise it will appear as `topic`.
func rpadminTopicsToStringSlice(in []rpadmin.NamespacedTopic) (resp []string) {
for _, entry := range in {
if entry.Namespace != nil {
Expand Down
4 changes: 1 addition & 3 deletions src/go/rpk/pkg/cli/cluster/storage/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ import (
)

func newMountCommand(fs afero.Fs, p *config.Params) *cobra.Command {
var (
to string
)
var to string

cmd := &cobra.Command{
Use: "mount [TOPIC]",
Expand Down
4 changes: 2 additions & 2 deletions src/go/rpk/pkg/cli/cluster/storage/status-mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ Status for a mount/unmount operation
adm, err := adminapi.NewClient(fs, pf)
out.MaybeDie(err, "unable to initialize admin client: %v", err)

migrationId, err := strconv.Atoi(from[0])
migrationID, err := strconv.Atoi(from[0])
out.MaybeDie(err, "invalid migration ID: %v", err)

status, err := adm.GetMigration(cmd.Context(), migrationId)
status, err := adm.GetMigration(cmd.Context(), migrationID)
out.MaybeDie(err, "unable to get the status of the migration: %v", err)
outStatus := migrationState{
ID: status.ID,
Expand Down
3 changes: 1 addition & 2 deletions src/go/rpk/pkg/cli/cluster/storage/unmount.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Key Points:
rpk cluster storage unmount my-namespace/my-topic
`,
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, topics []string) {
Run: func(_ *cobra.Command, topics []string) {
pf, err := p.LoadVirtualProfile(fs)
out.MaybeDie(err, "rpk unable to load config: %v", err)
config.CheckExitCloudAdmin(pf)
Expand All @@ -66,7 +66,6 @@ Key Points:
mg, err := adm.UnmountTopics(context.Background(), rpadmin.UnmountConfiguration{Topics: []rpadmin.NamespacedTopic{{Namespace: string2pointer(n), Topic: t}}})
out.MaybeDie(err, "unable to unmount topic: %v", err)
fmt.Fprintf(os.Stdout, "migration ID: %d\n", mg.ID)

},
}
return cmd
Expand Down

0 comments on commit cf4635d

Please sign in to comment.