tDo an error check on the final encode. - geoip - short golang utility to fetch geoip data from an API
HTML git clone https://git.parazyd.org/geoip
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
DIR commit 75066b543e1dce396f7e9ba75daac70b3b5e2674
DIR parent b5a354b3003d7f6a2d81b0441d8d476fb6393ffa
HTML Author: parazyd <parazyd@dyne.org>
Date: Fri, 2 Aug 2019 11:45:13 +0200
Do an error check on the final encode.
Diffstat:
M geoip.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
DIR diff --git a/geoip.go b/geoip.go
t@@ -53,5 +53,7 @@ func main() {
}
enc := json.NewEncoder(os.Stdout)
- enc.Encode(data)
+ if err := enc.Encode(data); err != nil {
+ log.Fatal(err)
+ }
}