This commit is contained in:
Nazar Kanaev 2020-10-20 20:54:05 +01:00
parent b766cb4ac5
commit 6a63d49823
7 changed files with 21 additions and 21 deletions

View File

@ -270,7 +270,7 @@ func listItems(f storage.Feed, db *storage.Storage) ([]storage.Item, error) {
} }
defer res.Body.Close() defer res.Body.Close()
if res.StatusCode / 100 == 4 || res.StatusCode / 100 == 5 { if res.StatusCode/100 == 4 || res.StatusCode/100 == 5 {
errmsg := fmt.Sprintf("Failed to list feed items for %s (status: %d)", f.FeedLink, res.StatusCode) errmsg := fmt.Sprintf("Failed to list feed items for %s (status: %d)", f.FeedLink, res.StatusCode)
return nil, errors.New(errmsg) return nil, errors.New(errmsg)
} }

View File

@ -2,9 +2,9 @@ package server
import ( import (
"bytes" "bytes"
"encoding/json"
"encoding/base64"
"compress/gzip" "compress/gzip"
"encoding/base64"
"encoding/json"
"fmt" "fmt"
"github.com/nkanaev/yarr/storage" "github.com/nkanaev/yarr/storage"
"html" "html"

View File

@ -2,8 +2,8 @@ package server
import ( import (
"encoding/json" "encoding/json"
"net/http"
"log" "log"
"net/http"
) )
func writeJSON(rw http.ResponseWriter, data interface{}) { func writeJSON(rw http.ResponseWriter, data interface{}) {