Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fbe2bb9

Browse files
committedApr 13, 2025·
fix bugs
1 parent 25918a5 commit fbe2bb9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed
 

Diff for: ‎app/dns/dns_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ func (*staticHandler) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
7676
case q.Name == "notexist.google.com." && q.Qtype == dns.TypeAAAA:
7777
ans.MsgHdr.Rcode = dns.RcodeNameError
7878

79+
case q.Name == "notexist.google.com." && q.Qtype == dns.TypeA:
80+
ans.MsgHdr.Rcode = dns.RcodeNameError
81+
7982
case q.Name == "hostname." && q.Qtype == dns.TypeA:
8083
rr, _ := dns.NewRR("hostname. IN A 127.0.0.1")
8184
ans.Answer = append(ans.Answer, rr)

Diff for: ‎app/dns/nameserver_tcp_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestTCPLocalNameServerWithCache(t *testing.T) {
5050
ips2, _, err := s.QueryIP(ctx2, "google.com", net.IP(nil), dns_feature.IPOption{
5151
IPv4Enable: true,
5252
IPv6Enable: true,
53-
}, true)
53+
}, false)
5454
cancel()
5555
common.Must(err)
5656
if r := cmp.Diff(ips2, ips); r != "" {

Diff for: ‎common/errors/multi_error.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package errors
22

33
import (
4+
"errors"
45
"strings"
56
)
67

@@ -36,12 +37,12 @@ func AllEqual(expected error, actual error) bool {
3637
return false
3738
}
3839
for _, err := range errs {
39-
if err != expected {
40+
if !errors.Is(err, expected) {
4041
return false
4142
}
4243
}
4344
return true
4445
default:
45-
return errs == expected
46+
return errors.Is(errs, expected)
4647
}
4748
}

0 commit comments

Comments
 (0)
Please sign in to comment.