Add errguards throughout the code to enable golangci-lint
This commit is contained in:
16 files changed
+148
-54
No files matched your search
@@ -36,7 +36,10 @@ func Update(alpmHandle *alpm.Handle, aurURL string, cacheDir string, interval in
|
||||
info, err := os.Stat(path)
|
||||
|
||||
if os.IsNotExist(err) || (interval != -1 && time.Since(info.ModTime()).Hours() >= float64(interval*24)) || force {
|
||||
os.MkdirAll(filepath.Dir(path), 0755)
|
||||
errd := os.MkdirAll(filepath.Dir(path), 0755)
|
||||
if errd != nil {
|
||||
return errd
|
||||
}
|
||||
out, errf := os.Create(path)
|
||||
if errf != nil {
|
||||
return errf
|
||||
|
||||
Reference in new issue
Block a user