fixed two ineffassign warnings

This commit is contained in:
BroodjeAap 2020-10-25 11:45:47 +01:00
parent f8c6d7fc4d
commit af35dd44c9
2 changed files with 5 additions and 1 deletions

View file

@ -267,7 +267,7 @@ func (server Server) streamRecordings(w http.ResponseWriter, r *http.Request) {
return return
} }
momentsJSON, _ := json.Marshal(moments) momentsJSON, _ := json.Marshal(moments)
err = momentsTemplate.Execute(w, struct { momentsTemplate.Execute(w, struct {
Streams map[string]*Stream Streams map[string]*Stream
MomentsJSON string MomentsJSON string
Moments [][]string Moments [][]string

View file

@ -64,6 +64,10 @@ func (s *Stream) Update() {
} }
s.Timeouts = 0 s.Timeouts = 0
img, err := ioutil.ReadAll(resp.Body) img, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Println(err)
return
}
defer resp.Body.Close() defer resp.Body.Close()
// Get the image from the response and write it to disk in a goroutine // Get the image from the response and write it to disk in a goroutine