1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-04 23:40:26 +08:00

chore: make lint happy

This commit is contained in:
源文雨
2024-07-11 18:26:17 +09:00
parent 2ad307df60
commit 9db2c9e0a6
2 changed files with 19 additions and 12 deletions

View File

@@ -4,8 +4,9 @@ linters-settings:
exclude-functions:
- fmt:.*
- io/ioutil:^Read.*
- github.com/fumiama/WireGold/helper.(*Writer).(Write.*)
- github.com/fumiama/WireGold/upper/services/tunnel.(*Tunnel).(Write|Read)
- os:\(\*File\)\..*
- github.com/fumiama/WireGold/helper:\(\*Writer\)\.Write.*
- github.com/fumiama/WireGold/upper/services/tunnel:\(\*Tunnel\)\.(Write|Read)
goimports:
local-prefixes: github.com/fumiama/WireGold

View File

@@ -41,11 +41,13 @@ func TestTunnel(t *testing.T) {
MTU: 4096,
})
m.AddPeer(&link.PeerConfig{
PeerIP: "192.168.1.3",
EndPoint: "127.0.0.1:21247",
AllowedIPs: []string{"192.168.1.3/32"},
PubicKey: peerpk.Public(),
MTU: 4096,
PeerIP: "192.168.1.3",
EndPoint: "127.0.0.1:21247",
AllowedIPs: []string{"192.168.1.3/32"},
PubicKey: peerpk.Public(),
MTU: 4096,
MTURandomRange: 1024,
UseZstd: true,
})
p := link.NewMe(&link.MyConfig{
MyIPwithMask: "192.168.1.3/32",
@@ -56,11 +58,13 @@ func TestTunnel(t *testing.T) {
MTU: 4096,
})
p.AddPeer(&link.PeerConfig{
PeerIP: "192.168.1.2",
EndPoint: "127.0.0.1:21246",
AllowedIPs: []string{"192.168.1.2/32"},
PubicKey: selfpk.Public(),
MTU: 4096,
PeerIP: "192.168.1.2",
EndPoint: "127.0.0.1:21246",
AllowedIPs: []string{"192.168.1.2/32"},
PubicKey: selfpk.Public(),
MTU: 4096,
MTURandomRange: 1024,
UseZstd: true,
})
tunnme, err := Create(&m, "192.168.1.3")
if err != nil {
@@ -102,6 +106,8 @@ func TestTunnel(t *testing.T) {
t.Log("read", n, "bytes")
if string(sendb) != string(buf) {
t.Fatal("error: recv 65535 bytes data")
t.Log("expect", hex.EncodeToString(sendb))
t.Log("got", hex.EncodeToString(buf))
}
tunnme.Stop()