mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Style: format code by gofumpt (#761)
This commit is contained in:
parent
d77be80b40
commit
e286cdcaa8
111 changed files with 293 additions and 291 deletions
|
@ -5,10 +5,11 @@
|
|||
package mocks
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
dns "github.com/xtls/xray-core/features/dns"
|
||||
net "net"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
dns "github.com/xtls/xray-core/features/dns"
|
||||
)
|
||||
|
||||
// DNSClient is a mock of Client interface
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
package mocks
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// Reader is a mock of Reader interface
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
package mocks
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
log "github.com/xtls/xray-core/common/log"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// LogHandler is a mock of Handler interface
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
package mocks
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
mux "github.com/xtls/xray-core/common/mux"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MuxClientWorkerFactory is a mock of ClientWorkerFactory interface
|
||||
|
|
|
@ -6,9 +6,10 @@ package mocks
|
|||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
outbound "github.com/xtls/xray-core/features/outbound"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// OutboundManager is a mock of Manager interface
|
||||
|
|
|
@ -108,12 +108,12 @@ func TestVMessDynamicPort(t *testing.T) {
|
|||
}
|
||||
|
||||
server, _ := InitializeServerConfig(serverConfig)
|
||||
if server != nil && tcpConnAvailableAtPort(t, serverPort + 100) {
|
||||
if server != nil && tcpConnAvailableAtPort(t, serverPort+100) {
|
||||
defer CloseServer(server)
|
||||
break
|
||||
}
|
||||
retry += 1
|
||||
if (retry > 5) {
|
||||
if retry > 5 {
|
||||
t.Fatal("All attempts failed to start server")
|
||||
}
|
||||
serverPort = tcp.PickPort()
|
||||
|
@ -174,7 +174,7 @@ func TestVMessDynamicPort(t *testing.T) {
|
|||
|
||||
func tcpConnAvailableAtPort(t *testing.T, port net.Port) bool {
|
||||
for i := 1; ; i++ {
|
||||
if (i > 10) {
|
||||
if i > 10 {
|
||||
t.Log("All attempts failed to test tcp conn")
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -97,7 +97,6 @@ func (server *Server) handleConnection(conn net.Conn) {
|
|||
}
|
||||
}
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("failed to transfer data: ", err.Error())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue