Skip to content

Commit 7e5ef26

Browse files
kevinburkeshuLhan
authored andcommitted
Simplify RestoreAsset
No need to do an error check here, we can simply return the value from os.Chtimes. Spotted by gosimple.
1 parent db443d7 commit 7e5ef26

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

restore.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ func RestoreAsset(dir, name string) error {
2929
if err != nil {
3030
return err
3131
}
32-
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
33-
if err != nil {
34-
return err
35-
}
36-
return nil
32+
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
3733
}
3834
3935
// RestoreAssets restores an asset under the given directory recursively

0 commit comments

Comments
 (0)