diff options
author | Valentin Rothberg <vrothberg@redhat.com> | 2022-05-19 10:45:28 +0200 |
---|---|---|
committer | Valentin Rothberg <vrothberg@redhat.com> | 2022-05-19 13:59:15 +0200 |
commit | b22143267bfd114d23ac25b08b71496f79092a91 (patch) | |
tree | 09b036d83ce54ed1c0e48ca76781a68f1a1d3ae6 /pkg/specgen/generate/container.go | |
parent | 7093885df73989acd2aa2dd936695d0b30a3dcf8 (diff) | |
download | podman-b22143267bfd114d23ac25b08b71496f79092a91.tar.gz podman-b22143267bfd114d23ac25b08b71496f79092a91.tar.bz2 podman-b22143267bfd114d23ac25b08b71496f79092a91.zip |
linter: enable unconvert linter
Detects unneccessary type conversions and helps in keeping the code base
cleaner.
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'pkg/specgen/generate/container.go')
-rw-r--r-- | pkg/specgen/generate/container.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go index d8008b10b..cc376125f 100644 --- a/pkg/specgen/generate/container.go +++ b/pkg/specgen/generate/container.go @@ -303,8 +303,8 @@ func FinishThrottleDevices(s *specgen.SpecGenerator) error { if err := unix.Stat(k, &statT); err != nil { return err } - v.Major = (int64(unix.Major(uint64(statT.Rdev)))) - v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) + v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert + v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert if s.ResourceLimits.BlockIO == nil { s.ResourceLimits.BlockIO = new(spec.LinuxBlockIO) } @@ -317,8 +317,8 @@ func FinishThrottleDevices(s *specgen.SpecGenerator) error { if err := unix.Stat(k, &statT); err != nil { return err } - v.Major = (int64(unix.Major(uint64(statT.Rdev)))) - v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) + v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert + v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert s.ResourceLimits.BlockIO.ThrottleWriteBpsDevice = append(s.ResourceLimits.BlockIO.ThrottleWriteBpsDevice, v) } } @@ -328,8 +328,8 @@ func FinishThrottleDevices(s *specgen.SpecGenerator) error { if err := unix.Stat(k, &statT); err != nil { return err } - v.Major = (int64(unix.Major(uint64(statT.Rdev)))) - v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) + v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert + v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert s.ResourceLimits.BlockIO.ThrottleReadIOPSDevice = append(s.ResourceLimits.BlockIO.ThrottleReadIOPSDevice, v) } } @@ -339,8 +339,8 @@ func FinishThrottleDevices(s *specgen.SpecGenerator) error { if err := unix.Stat(k, &statT); err != nil { return err } - v.Major = (int64(unix.Major(uint64(statT.Rdev)))) - v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) + v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert + v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert s.ResourceLimits.BlockIO.ThrottleWriteIOPSDevice = append(s.ResourceLimits.BlockIO.ThrottleWriteIOPSDevice, v) } } |