fix(QF1003): Convert if/else-if chain to tagged switch

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2025-04-28 18:35:09 +02:00
parent c80675bfe1
commit 54efe295f0
2 changed files with 6 additions and 6 deletions

View File

@ -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 functions name
- -ST1022 # FIXME The documentation of an exported variable or constant should start with variables name
- -QF1008 # Omit embedded fields from selector expression
- -ST1020 # The documentation of an exported function should start with the functions name
- -ST1022 # The documentation of an exported variable or constant should start with variables name
revive:
rules:

View File

@ -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{}
}