[golangci-lint] Added error handling for h.Write.

This commit is contained in:
mdosch 2019-06-14 11:39:18 +02:00
parent 8ac7a60770
commit c6b881a883

View file

@ -70,7 +70,10 @@ func getArticles(feedURL string, max int, noExcerpt bool, filter []string) (stri
// Create a hash as identifier for the feed. // Create a hash as identifier for the feed.
// The identifier will be used as filename for caching the update time. // The identifier will be used as filename for caching the update time.
h := fnv.New32a() h := fnv.New32a()
h.Write([]byte(feedURL)) _, err := h.Write([]byte(feedURL))
if err != nil {
log.Fatal("Error: Can't create hash for", feedURL + ":", err)
}
if _, err := os.Stat(cachePath); os.IsNotExist(err) { if _, err := os.Stat(cachePath); os.IsNotExist(err) {
err = os.MkdirAll(cachePath, 0700) err = os.MkdirAll(cachePath, 0700)
if err != nil { if err != nil {