Skip to content

Commit

Permalink
Check sync error
Browse files Browse the repository at this point in the history
  • Loading branch information
bahlo committed Oct 3, 2021
1 parent b10600d commit bf270f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ func main() {
fmt.Fprintf(os.Stderr, "Failed build logger: %v", err)
return
}
defer logger.Sync()
defer func() {
if err := logger.Sync(); err != nil {
fmt.Fprintf(os.Stderr, "Failed to sync logger: %v", err)
}
}()

cfg, err := ReadConfig("mapdns.json")
if err != nil {
Expand Down

0 comments on commit bf270f3

Please sign in to comment.