1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-28 13:05:28 -05:00

Fix according to staticcheck result

staticcheck repo: https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck
This commit is contained in:
loyalsoldier
2020-08-30 22:58:00 +08:00
parent 1fa89b32d4
commit f12f76582f
10 changed files with 22 additions and 30 deletions

View File

@@ -12,7 +12,6 @@ import (
"golang.org/x/net/dns/dnsmessage"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
v2net "v2ray.com/core/common/net"
)
func Test_parseResponse(t *testing.T) {
@@ -52,7 +51,7 @@ func Test_parseResponse(t *testing.T) {
wantErr bool
}{
{"empty",
&IPRecord{0, []v2net.Address(nil), time.Time{}, dnsmessage.RCodeSuccess},
&IPRecord{0, []net.Address(nil), time.Time{}, dnsmessage.RCodeSuccess},
false,
},
{"error",
@@ -60,12 +59,12 @@ func Test_parseResponse(t *testing.T) {
true,
},
{"a record",
&IPRecord{1, []v2net.Address{v2net.ParseAddress("8.8.8.8"), v2net.ParseAddress("8.8.4.4")},
&IPRecord{1, []net.Address{net.ParseAddress("8.8.8.8"), net.ParseAddress("8.8.4.4")},
time.Time{}, dnsmessage.RCodeSuccess},
false,
},
{"aaaa record",
&IPRecord{2, []v2net.Address{v2net.ParseAddress("2001::123:8888"), v2net.ParseAddress("2001::123:8844")}, time.Time{}, dnsmessage.RCodeSuccess},
&IPRecord{2, []net.Address{net.ParseAddress("2001::123:8888"), net.ParseAddress("2001::123:8844")}, time.Time{}, dnsmessage.RCodeSuccess},
false,
},
}