Remove IDE-specific noise from source code.

This commit is contained in:
Eugene Bujak
2018-11-27 15:31:38 +03:00
parent 89753c4efb
commit 47e2a1004d
14 changed files with 4 additions and 52 deletions

View File

@@ -161,7 +161,6 @@ func setupPlugin(c *caddy.Controller) (*plug, error) {
if err != nil {
return nil, err
}
//noinspection GoDeferInLoop
defer file.Close()
count := 0
@@ -271,7 +270,6 @@ func (p *plug) onFinalShutdown() error {
type statsFunc func(ch interface{}, name string, text string, value float64, valueType prometheus.ValueType)
//noinspection GoUnusedParameter
func doDesc(ch interface{}, name string, text string, value float64, valueType prometheus.ValueType) {
realch, ok := ch.(chan<- *prometheus.Desc)
if !ok {

View File

@@ -105,7 +105,6 @@ func logRequest(question *dns.Msg, answer *dns.Msg, result dnsfilter.Result, ela
}
}
//noinspection GoUnusedParameter
func HandleQueryLog(w http.ResponseWriter, r *http.Request) {
queryLogLock.RLock()
values := make([]*logEntry, len(queryLogCache))
@@ -140,10 +139,10 @@ func HandleQueryLog(w http.ResponseWriter, r *http.Request) {
}
jsonEntry := map[string]interface{}{
"reason": entry.Result.Reason.String(),
"reason": entry.Result.Reason.String(),
"elapsedMs": strconv.FormatFloat(entry.Elapsed.Seconds()*1000, 'f', -1, 64),
"time": entry.Time.Format(time.RFC3339),
"client": entry.IP,
"time": entry.Time.Format(time.RFC3339),
"client": entry.IP,
}
if q != nil {
jsonEntry["question"] = map[string]interface{}{

View File

@@ -61,7 +61,6 @@ func (p *plug) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
}
func (p *plug) allowRequest(ip string) (bool, error) {
if len(p.whitelist) > 0 {
i := sort.SearchStrings(p.whitelist, ip)
@@ -114,7 +113,6 @@ type plug struct {
}
func setupPlugin(c *caddy.Controller) (*plug, error) {
p := &plug{ratelimit: defaultRatelimit}
for c.Next() {

View File

@@ -36,7 +36,6 @@ func TestSetup(t *testing.T) {
}
func TestRatelimiting(t *testing.T) {
// rate limit is 1 per sec
c := caddy.NewTestController("dns", `ratelimit 1`)
p, err := setupPlugin(c)
@@ -59,7 +58,6 @@ func TestRatelimiting(t *testing.T) {
}
func TestWhitelist(t *testing.T) {
// rate limit is 1 per sec
c := caddy.NewTestController("dns", `ratelimit 1 { whitelist 127.0.0.2 127.0.0.1 127.0.0.125 }`)
p, err := setupPlugin(c)