Style: format code by gofumpt (#761)

This commit is contained in:
yuhan6665 2021-10-19 12:57:14 -04:00 committed by GitHub
parent d77be80b40
commit e286cdcaa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 293 additions and 291 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
}

View file

@ -97,7 +97,6 @@ func (server *Server) handleConnection(conn net.Conn) {
}
}
})
if err != nil {
fmt.Println("failed to transfer data: ", err.Error())
}