From b22143267bfd114d23ac25b08b71496f79092a91 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 19 May 2022 10:45:28 +0200 Subject: linter: enable unconvert linter Detects unneccessary type conversions and helps in keeping the code base cleaner. Signed-off-by: Valentin Rothberg --- pkg/domain/infra/abi/containers.go | 2 +- pkg/domain/infra/abi/parse/parse.go | 2 +- pkg/domain/infra/abi/system.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/domain') diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index 4e9f38b95..d2fafccb1 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -1113,7 +1113,7 @@ func (ic *ContainerEngine) GetContainerExitCode(ctx context.Context, ctr *libpod time.Sleep(250 * time.Millisecond) continue } - return int(event.ContainerExitCode) + return event.ContainerExitCode } logrus.Errorf("Could not retrieve exit code from event: %v", err) return define.ExecErrorCodeNotFound diff --git a/pkg/domain/infra/abi/parse/parse.go b/pkg/domain/infra/abi/parse/parse.go index 3bac2ef99..66794e592 100644 --- a/pkg/domain/infra/abi/parse/parse.go +++ b/pkg/domain/infra/abi/parse/parse.go @@ -43,7 +43,7 @@ func VolumeOptions(opts map[string]string) ([]libpod.VolumeCreateOption, error) if err != nil { return nil, errors.Wrapf(err, "cannot convert inodes %s to integer", splitO[1]) } - libpodOptions = append(libpodOptions, libpod.WithVolumeInodes(uint64(inodes))) + libpodOptions = append(libpodOptions, libpod.WithVolumeInodes(inodes)) finalVal = append(finalVal, o) // set option "INODES": "$size" volumeOptions["INODES"] = splitO[1] diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index 17df0e3f8..10f3e70b1 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -216,9 +216,9 @@ func (ic *ContainerEngine) SystemDf(ctx context.Context, options entities.System Tag: stat.Tag, ImageID: stat.ID, Created: stat.Created, - Size: int64(stat.Size), - SharedSize: int64(stat.SharedSize), - UniqueSize: int64(stat.UniqueSize), + Size: stat.Size, + SharedSize: stat.SharedSize, + UniqueSize: stat.UniqueSize, Containers: stat.Containers, } dfImages = append(dfImages, &report) -- cgit v1.2.3-54-g00ecf