mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #44250 from thaJeztah/fix_pkg_dir
pkg/directory: Size(): add back type-casts to account for platform differences
This commit is contained in:
commit
59c77c8f5b
1 changed files with 4 additions and 4 deletions
|
@ -40,12 +40,12 @@ func Size(ctx context.Context, dir string) (size int64, err error) {
|
||||||
|
|
||||||
// Check inode to handle hard links correctly
|
// Check inode to handle hard links correctly
|
||||||
inode := fileInfo.Sys().(*syscall.Stat_t).Ino
|
inode := fileInfo.Sys().(*syscall.Stat_t).Ino
|
||||||
// inode is not a uint64 on all platforms. Cast it to avoid issues.
|
//nolint:unconvert // inode is not an uint64 on all platforms.
|
||||||
if _, exists := data[inode]; exists {
|
if _, exists := data[uint64(inode)]; exists {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// inode is not a uint64 on all platforms. Cast it to avoid issues.
|
|
||||||
data[inode] = struct{}{}
|
data[uint64(inode)] = struct{}{} //nolint:unconvert // inode is not an uint64 on all platforms.
|
||||||
|
|
||||||
size += s
|
size += s
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue