Skip to content

Commit

Permalink
Merge pull request #107 from tiborvass/fix-32bit
Browse files Browse the repository at this point in the history
Add comment about why an int64 conversion is needed in fs.StatATimeAsTime
  • Loading branch information
stevvooe authored Feb 16, 2018
2 parents d876b2b + 854c975 commit d8fb858
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/stat_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ func StatMtime(st *syscall.Stat_t) syscall.Timespec {

// StatATimeAsTime returns st.Atim as a time.Time
func StatATimeAsTime(st *syscall.Stat_t) time.Time {
// The int64 conversions ensure the line compiles for 32-bit systems as well.
return time.Unix(int64(st.Atim.Sec), int64(st.Atim.Nsec)) // nolint: unconvert
}

0 comments on commit d8fb858

Please sign in to comment.