Small if err cleaning

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca 2015-04-26 18:50:25 +02:00
parent f023195a1e
commit 2026dbd41d
5 changed files with 5 additions and 10 deletions

View file

@ -20,8 +20,7 @@ func fromStatT(s *syscall.Stat_t) (*Stat_t, error) {
// Throws an error if the file does not exist
func Stat(path string) (*Stat_t, error) {
s := &syscall.Stat_t{}
err := syscall.Stat(path, s)
if err != nil {
if err := syscall.Stat(path, s); err != nil {
return nil, err
}
return fromStatT(s)