cherry-pick: upd-go

Merge in DNS/adguard-home from upd-go to master

Squashed commit of the following:

commit 8edfb5cc3466c1e4ee2eacae5157bd93c135a284
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Aug 3 14:25:45 2022 +0300

    all: imp docs; fmt

commit 080b8a85c02afbdaa079c0da47cb7b6311d50fbe
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Aug 2 20:51:20 2022 +0300

    all: upd go, imp generic code
This commit is contained in:
Ainar Garipov
2022-08-03 14:36:18 +03:00
committed by Ainar Garipov
parent 133cd9ef6b
commit 8166c4bc33
33 changed files with 291 additions and 313 deletions

View File

@@ -61,22 +61,22 @@ func TestDNSFilter_CheckHostRules_dnsrewrite(t *testing.T) {
testCasesA := []struct {
name string
want []interface{}
want []any
rcode int
dtyp uint16
}{{
name: "a-record",
rcode: dns.RcodeSuccess,
want: []interface{}{ipv4p1},
want: []any{ipv4p1},
dtyp: dns.TypeA,
}, {
name: "aaaa-record",
want: []interface{}{ipv6p1},
want: []any{ipv6p1},
rcode: dns.RcodeSuccess,
dtyp: dns.TypeAAAA,
}, {
name: "txt-record",
want: []interface{}{"hello-world"},
want: []any{"hello-world"},
rcode: dns.RcodeSuccess,
dtyp: dns.TypeTXT,
}, {
@@ -86,22 +86,22 @@ func TestDNSFilter_CheckHostRules_dnsrewrite(t *testing.T) {
dtyp: 0,
}, {
name: "a-records",
want: []interface{}{ipv4p1, ipv4p2},
want: []any{ipv4p1, ipv4p2},
rcode: dns.RcodeSuccess,
dtyp: dns.TypeA,
}, {
name: "aaaa-records",
want: []interface{}{ipv6p1, ipv6p2},
want: []any{ipv6p1, ipv6p2},
rcode: dns.RcodeSuccess,
dtyp: dns.TypeAAAA,
}, {
name: "disable-one",
want: []interface{}{ipv4p2},
want: []any{ipv4p2},
rcode: dns.RcodeSuccess,
dtyp: dns.TypeA,
}, {
name: "disable-cname",
want: []interface{}{ipv4p1},
want: []any{ipv4p1},
rcode: dns.RcodeSuccess,
dtyp: dns.TypeA,
}}