From 6fc50cd743a38f681b151703bbe06dd9cbc8e07c Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Fri, 7 Sep 2018 16:10:43 +0300 Subject: [PATCH] dnsfilter -- small code cleanup --- dnsfilter/dnsfilter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dnsfilter/dnsfilter.go b/dnsfilter/dnsfilter.go index 59d731b6..b9305948 100644 --- a/dnsfilter/dnsfilter.go +++ b/dnsfilter/dnsfilter.go @@ -521,11 +521,11 @@ func (d *Dnsfilter) checkSafeBrowsing(host string) (Result, error) { } func (d *Dnsfilter) checkParental(host string) (Result, error) { - format2 := func(hashparam string) string { + format := func(hashparam string) string { url := fmt.Sprintf(defaultParentalURL, hashparam, d.config.parentalSensitivity) return url } - handleBody2 := func(body []byte, hashes map[string]bool) (Result, error) { + handleBody := func(body []byte, hashes map[string]bool) (Result, error) { // parse json var m []struct { Blocked bool `json:"blocked"` @@ -551,7 +551,7 @@ func (d *Dnsfilter) checkParental(host string) (Result, error) { } return result, nil } - result, err := d.lookupCommon(host, &stats.Parental, parentalCache, false, format2, handleBody2) + result, err := d.lookupCommon(host, &stats.Parental, parentalCache, false, format, handleBody) return result, err }