Add unconvert linter

This linter checks for unnecessary type convertions.

Some convertions are whitelisted because their type is different
on 32bit platforms

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin
2018-01-08 17:24:43 -05:00
parent 50a6c62492
commit 184bc25629
14 changed files with 42 additions and 30 deletions

View File

@@ -4,6 +4,7 @@ package sys
import (
"syscall"
"time"
)
// StatAtime returns the Atim
@@ -20,3 +21,8 @@ func StatCtime(st *syscall.Stat_t) syscall.Timespec {
func StatMtime(st *syscall.Stat_t) syscall.Timespec {
return st.Mtim
}
// StatATimeAsTime returns st.Atim as a time.Time
func StatATimeAsTime(st *syscall.Stat_t) time.Time {
return time.Unix(st.Atim.Sec, st.Atim.Nsec)
}