Skip to content

Commit

Permalink
Lint: fix according to golangci-lint (p4gefau1t#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loyalsoldier authored May 20, 2021
1 parent 02ade3f commit 6694670
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tunnel/freedom/freedom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestSocks(t *testing.T) {
noDelay: true,
}
target, err := tunnel.NewAddressFromAddr("tcp", util.EchoAddr)

common.Must(err)
s, _ := socks5.NewClassicServer(socksAddr.String(), "127.0.0.1", "", "", 0, 0)
s.Handle = &socks5.DefaultHandle{}
go s.RunTCPServer()
Expand Down
4 changes: 3 additions & 1 deletion tunnel/trojan/trojan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ func TestTrojan(t *testing.T) {
c, err := NewClient(clientCtx, tcpClient)
common.Must(err)
s, err := NewServer(serverCtx, tcpServer)

common.Must(err)
conn1, err := c.DialConn(&tunnel.Address{
DomainName: "example.com",
AddressType: tunnel.DomainName,
}, nil)
common.Must(err)
common.Must2(conn1.Write([]byte("87654321")))
conn2, err := s.AcceptConn(nil)
common.Must(err)
buf := [8]byte{}
conn2.Read(buf[:])
if !util.CheckConn(conn1, conn2) {
Expand Down
3 changes: 3 additions & 0 deletions tunnel/websocket/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ func (s *Server) AcceptConn(tunnel.Tunnel) (tunnel.Conn, error) {
url := "wss://" + s.hostname + s.path
origin := "https://" + s.hostname
wsConfig, err := websocket.NewConfig(url, origin)
if err != nil {
return nil, common.NewError("failed to create websocket config").Base(err)
}
var wsConn *websocket.Conn
ctx, cancel := context.WithCancel(s.ctx)

Expand Down

0 comments on commit 6694670

Please sign in to comment.