Add errguards throughout the code to enable golangci-lint

This commit is contained in:
Jguer committed 2019-10-13 20:56:27 +01:00
1 parent 422a5931af
commit a591b33262
16 files changed
+148 -54

No files matched your search

+4 -1
View File
@@ -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