fix load
This commit is contained in:
parent
a432c70c0a
commit
7ca5f77545
7
main.go
7
main.go
|
@ -59,13 +59,18 @@ func main() {
|
|||
func load() {
|
||||
_, err := os.Stat(blocklistFile)
|
||||
if os.IsNotExist(err) {
|
||||
log.Warnf("No blocklistFile: %V\n", err)
|
||||
return
|
||||
}
|
||||
bytes, err := ioutil.ReadFile(blocklistFile)
|
||||
if err != nil {
|
||||
log.Errorf("Couldn't read blocklist file: %v\n", err)
|
||||
return
|
||||
}
|
||||
json.Unmarshal(bytes, blocklistedIps)
|
||||
err = json.Unmarshal(bytes, &blocklistedIps)
|
||||
if err != nil {
|
||||
log.Errorf("Couldn't unmarshal blocklisted IPs: %v\n", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue