Skip to content

Commit

Permalink
Check error of file.Seek()
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdeltwabMF committed Mar 30, 2024
1 parent 3c171c5 commit b2c7d64
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/localcal/localcal.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@ func Load(ch chan<- *configs.Events, errch chan<- error) {

for {
var events configs.Events
file.Seek(0, 0)
_, err := file.Seek(0, 0)
if err != nil {
errch <- err
return
}

err := json.NewDecoder(file).Decode(&events)
err = json.NewDecoder(file).Decode(&events)
if err != nil {
errch <- err
return
Expand Down

0 comments on commit b2c7d64

Please sign in to comment.