From 54efe295f0b40a96ba9515501112df8d7f6511c4 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Mon, 28 Apr 2025 18:35:09 +0200 Subject: [PATCH] fix(QF1003): Convert if/else-if chain to tagged switch Signed-off-by: Matthieu MOREL --- .golangci.yml | 7 +++---- cli/command/volume/create.go | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index c49f5d53b..58c7f4ead 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -116,10 +116,9 @@ linters: staticcheck: checks: - all - - -QF1003 # FIXME Convert if/else-if chain to tagged switch - - -QF1008 # FIXME Omit embedded fields from selector expression - - -ST1020 # FIXME The documentation of an exported function should start with the function’s name - - -ST1022 # FIXME The documentation of an exported variable or constant should start with variable’s name + - -QF1008 # Omit embedded fields from selector expression + - -ST1020 # The documentation of an exported function should start with the function’s name + - -ST1022 # The documentation of an exported variable or constant should start with variable’s name revive: rules: diff --git a/cli/command/volume/create.go b/cli/command/volume/create.go index 4092dcd85..164ff2ebf 100644 --- a/cli/command/volume/create.go +++ b/cli/command/volume/create.go @@ -129,9 +129,10 @@ func runCreate(ctx context.Context, dockerCli command.Cli, options createOptions Availability: volume.Availability(options.availability), } - if options.accessType == "mount" { + switch options.accessType { + case "mount": volOpts.ClusterVolumeSpec.AccessMode.MountVolume = &volume.TypeMount{} - } else if options.accessType == "block" { + case "block": volOpts.ClusterVolumeSpec.AccessMode.BlockVolume = &volume.TypeBlock{} }