Skip to content

Commit

Permalink
ci: fix warnings, enable gosimple linter
Browse files Browse the repository at this point in the history
Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed May 26, 2023
1 parent b99949b commit e2e5530
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ run:
linters:
disable:
- errcheck
- gosimple
- staticcheck
2 changes: 1 addition & 1 deletion drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func getMountProgramFlagFile(path string) string {
}

func checkSupportVolatile(home, runhome string) (bool, error) {
feature := fmt.Sprintf("volatile")
const feature = "volatile"
volatileCacheResult, _, err := cachedFeatureCheck(runhome, feature)
var usingVolatile bool
if err == nil {
Expand Down
8 changes: 3 additions & 5 deletions pkg/devicemapper/devmapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ func RemoveDeviceDeferred(name string) error {
// disable udev dm rules and delete the symlink under /dev/mapper by itself,
// even if the removal is deferred by the kernel.
cookie := new(uint)
var flags uint16
flags = DmUdevDisableLibraryFallback
flags := uint16(DmUdevDisableLibraryFallback)
if err := task.setCookie(cookie, flags); err != nil {
return fmt.Errorf("devicemapper: Can not set cookie: %s", err)
}
Expand Down Expand Up @@ -384,7 +383,7 @@ func CancelDeferredRemove(deviceName string) error {
return fmt.Errorf("devicemapper: Can't set sector %s", err)
}

if err := task.setMessage(fmt.Sprintf("@cancel_deferred_remove")); err != nil {
if err := task.setMessage("@cancel_deferred_remove"); err != nil {
return fmt.Errorf("devicemapper: Can't set message %s", err)
}

Expand Down Expand Up @@ -459,8 +458,7 @@ func CreatePool(poolName string, dataFile, metadataFile *os.File, poolBlockSize
}

cookie := new(uint)
var flags uint16
flags = DmUdevDisableSubsystemRulesFlag | DmUdevDisableDiskRulesFlag | DmUdevDisableOtherRulesFlag
flags := uint16(DmUdevDisableSubsystemRulesFlag | DmUdevDisableDiskRulesFlag | DmUdevDisableOtherRulesFlag)
if err := task.setCookie(cookie, flags); err != nil {
return fmt.Errorf("devicemapper: Can't set cookie %s", err)
}
Expand Down

0 comments on commit e2e5530

Please sign in to comment.