From 2cc3b11e0fefe63da68ff56885f5056ba3875d57 Mon Sep 17 00:00:00 2001 From: Dzyanis Kuzmenka Date: Thu, 17 Mar 2022 23:30:36 +0300 Subject: [PATCH] improve goimport format --- .golangci.yml | 4 +--- client/admin.go | 4 ++-- client/control.go | 10 +++++----- client/proxy/proxy.go | 16 ++++++++-------- client/proxy/proxy_manager.go | 4 ++-- client/proxy/proxy_wrapper.go | 4 ++-- client/service.go | 6 +++--- client/visitor.go | 10 +++++----- cmd/frpc/main.go | 4 ++-- cmd/frpc/sub/http.go | 4 ++-- cmd/frpc/sub/reload.go | 4 ++-- cmd/frpc/sub/root.go | 4 ++-- cmd/frpc/sub/status.go | 6 +++--- cmd/frpc/sub/stcp.go | 4 ++-- cmd/frpc/sub/sudp.go | 4 ++-- cmd/frpc/sub/udp.go | 4 ++-- cmd/frpc/sub/verify.go | 4 ++-- cmd/frpc/sub/xtcp.go | 4 ++-- cmd/frps/root.go | 4 ++-- cmd/frps/verify.go | 4 ++-- pkg/auth/oidc.go | 4 ++-- pkg/config/client.go | 4 ++-- pkg/config/client_test.go | 4 ++-- pkg/config/proxy.go | 4 ++-- pkg/config/proxy_test.go | 4 ++-- pkg/config/server.go | 6 +++--- pkg/config/server_test.go | 4 ++-- pkg/config/visitor.go | 4 ++-- pkg/config/visitor_test.go | 4 ++-- pkg/metrics/prometheus/server.go | 4 ++-- pkg/nathole/nathole.go | 6 +++--- pkg/plugin/client/http_proxy.go | 4 ++-- pkg/plugin/client/socks5.go | 4 ++-- pkg/plugin/client/static_file.go | 4 ++-- pkg/proto/udp/udp.go | 4 ++-- pkg/util/vhost/http.go | 4 ++-- pkg/util/vhost/vhost.go | 4 ++-- server/control.go | 8 ++++---- server/dashboard.go | 6 +++--- server/dashboard_api.go | 4 ++-- server/group/tcp.go | 4 ++-- server/group/tcpmux.go | 4 ++-- server/proxy/http.go | 4 ++-- server/proxy/proxy.go | 4 ++-- server/proxy/udp.go | 6 +++--- server/proxy/xtcp.go | 4 ++-- server/service.go | 6 +++--- server/visitor/visitor.go | 4 ++-- test/e2e/basic/basic.go | 4 ++-- test/e2e/basic/client.go | 4 ++-- test/e2e/basic/client_server.go | 4 ++-- test/e2e/basic/cmd.go | 4 ++-- test/e2e/basic/config.go | 4 ++-- test/e2e/basic/http.go | 6 +++--- test/e2e/basic/server.go | 4 ++-- test/e2e/e2e.go | 6 +++--- test/e2e/e2e_test.go | 8 +++----- test/e2e/examples.go | 4 ++-- test/e2e/features/bandwidth_limit.go | 4 ++-- test/e2e/features/chaos.go | 4 ++-- test/e2e/features/group.go | 4 ++-- test/e2e/features/heartbeat.go | 4 ++-- test/e2e/features/monitor.go | 4 ++-- test/e2e/features/real_ip.go | 6 +++--- test/e2e/framework/framework.go | 6 +++--- test/e2e/pkg/request/request.go | 3 ++- test/e2e/plugin/client.go | 4 ++-- test/e2e/plugin/server.go | 4 ++-- 68 files changed, 161 insertions(+), 164 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f225b9ce..a31ee983 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -64,8 +64,6 @@ linters: - maintidx - unparam - nakedret - # - misspell - - goimports - goconst - wastedassign - gosimple @@ -75,7 +73,7 @@ linters: - unused - promlinter - nestif - - gci + # - gci - errorlint - ineffassign - lll diff --git a/client/admin.go b/client/admin.go index 6a6ceecb..90cdffea 100644 --- a/client/admin.go +++ b/client/admin.go @@ -20,10 +20,10 @@ import ( "net/http/pprof" "time" + "github.com/gorilla/mux" + "github.com/fatedier/frp/assets" frpNet "github.com/fatedier/frp/pkg/util/net" - - "github.com/gorilla/mux" ) var ( diff --git a/client/control.go b/client/control.go index 81aaf7be..8e09c41e 100644 --- a/client/control.go +++ b/client/control.go @@ -24,6 +24,11 @@ import ( "sync" "time" + "github.com/fatedier/golib/control/shutdown" + "github.com/fatedier/golib/crypto" + libdial "github.com/fatedier/golib/net/dial" + fmux "github.com/hashicorp/yamux" + "github.com/fatedier/frp/client/proxy" "github.com/fatedier/frp/pkg/auth" "github.com/fatedier/frp/pkg/config" @@ -31,11 +36,6 @@ import ( "github.com/fatedier/frp/pkg/transport" frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/fatedier/frp/pkg/util/xlog" - - "github.com/fatedier/golib/control/shutdown" - "github.com/fatedier/golib/crypto" - libdial "github.com/fatedier/golib/net/dial" - fmux "github.com/hashicorp/yamux" ) type Control struct { diff --git a/client/proxy/proxy.go b/client/proxy/proxy.go index 4c1ec548..2dc03ea2 100644 --- a/client/proxy/proxy.go +++ b/client/proxy/proxy.go @@ -25,14 +25,6 @@ import ( "sync" "time" - "github.com/fatedier/frp/pkg/config" - "github.com/fatedier/frp/pkg/msg" - plugin "github.com/fatedier/frp/pkg/plugin/client" - "github.com/fatedier/frp/pkg/proto/udp" - "github.com/fatedier/frp/pkg/util/limit" - frpNet "github.com/fatedier/frp/pkg/util/net" - "github.com/fatedier/frp/pkg/util/xlog" - "github.com/fatedier/golib/errors" frpIo "github.com/fatedier/golib/io" libdial "github.com/fatedier/golib/net/dial" @@ -40,6 +32,14 @@ import ( fmux "github.com/hashicorp/yamux" pp "github.com/pires/go-proxyproto" "golang.org/x/time/rate" + + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" + plugin "github.com/fatedier/frp/pkg/plugin/client" + "github.com/fatedier/frp/pkg/proto/udp" + "github.com/fatedier/frp/pkg/util/limit" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/xlog" ) // Proxy defines how to handle work connections for different proxy type. diff --git a/client/proxy/proxy_manager.go b/client/proxy/proxy_manager.go index c4585946..0b4f7d54 100644 --- a/client/proxy/proxy_manager.go +++ b/client/proxy/proxy_manager.go @@ -6,12 +6,12 @@ import ( "net" "sync" + "github.com/fatedier/golib/errors" + "github.com/fatedier/frp/client/event" "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/msg" "github.com/fatedier/frp/pkg/util/xlog" - - "github.com/fatedier/golib/errors" ) type Manager struct { diff --git a/client/proxy/proxy_wrapper.go b/client/proxy/proxy_wrapper.go index a6f0233b..37341444 100644 --- a/client/proxy/proxy_wrapper.go +++ b/client/proxy/proxy_wrapper.go @@ -8,13 +8,13 @@ import ( "sync/atomic" "time" + "github.com/fatedier/golib/errors" + "github.com/fatedier/frp/client/event" "github.com/fatedier/frp/client/health" "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/msg" "github.com/fatedier/frp/pkg/util/xlog" - - "github.com/fatedier/golib/errors" ) const ( diff --git a/client/service.go b/client/service.go index 83a4c9dc..e88e26db 100644 --- a/client/service.go +++ b/client/service.go @@ -26,6 +26,9 @@ import ( "sync/atomic" "time" + libdial "github.com/fatedier/golib/net/dial" + fmux "github.com/hashicorp/yamux" + "github.com/fatedier/frp/assets" "github.com/fatedier/frp/pkg/auth" "github.com/fatedier/frp/pkg/config" @@ -36,9 +39,6 @@ import ( "github.com/fatedier/frp/pkg/util/util" "github.com/fatedier/frp/pkg/util/version" "github.com/fatedier/frp/pkg/util/xlog" - libdial "github.com/fatedier/golib/net/dial" - - fmux "github.com/hashicorp/yamux" ) // Service is a client service. diff --git a/client/visitor.go b/client/visitor.go index ea548298..674924cb 100644 --- a/client/visitor.go +++ b/client/visitor.go @@ -24,17 +24,17 @@ import ( "sync" "time" + "github.com/fatedier/golib/errors" + frpIo "github.com/fatedier/golib/io" + "github.com/fatedier/golib/pool" + fmux "github.com/hashicorp/yamux" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/msg" "github.com/fatedier/frp/pkg/proto/udp" frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/fatedier/frp/pkg/util/util" "github.com/fatedier/frp/pkg/util/xlog" - - "github.com/fatedier/golib/errors" - frpIo "github.com/fatedier/golib/io" - "github.com/fatedier/golib/pool" - fmux "github.com/hashicorp/yamux" ) // Visitor is used for forward traffics from local port tot remote service. diff --git a/cmd/frpc/main.go b/cmd/frpc/main.go index 2c1e0150..36d421f2 100644 --- a/cmd/frpc/main.go +++ b/cmd/frpc/main.go @@ -18,10 +18,10 @@ import ( "math/rand" "time" + "github.com/fatedier/golib/crypto" + _ "github.com/fatedier/frp/assets/frpc" "github.com/fatedier/frp/cmd/frpc/sub" - - "github.com/fatedier/golib/crypto" ) func main() { diff --git a/cmd/frpc/sub/http.go b/cmd/frpc/sub/http.go index 2e19fce4..4e193b7e 100644 --- a/cmd/frpc/sub/http.go +++ b/cmd/frpc/sub/http.go @@ -19,10 +19,10 @@ import ( "os" "strings" + "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/consts" - - "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frpc/sub/reload.go b/cmd/frpc/sub/reload.go index c625daed..258317e7 100644 --- a/cmd/frpc/sub/reload.go +++ b/cmd/frpc/sub/reload.go @@ -22,9 +22,9 @@ import ( "os" "strings" - "github.com/fatedier/frp/pkg/config" - "github.com/spf13/cobra" + + "github.com/fatedier/frp/pkg/config" ) func init() { diff --git a/cmd/frpc/sub/root.go b/cmd/frpc/sub/root.go index a48a801d..34213573 100644 --- a/cmd/frpc/sub/root.go +++ b/cmd/frpc/sub/root.go @@ -25,13 +25,13 @@ import ( "syscall" "time" + "github.com/spf13/cobra" + "github.com/fatedier/frp/client" "github.com/fatedier/frp/pkg/auth" "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/pkg/util/version" - - "github.com/spf13/cobra" ) const ( diff --git a/cmd/frpc/sub/status.go b/cmd/frpc/sub/status.go index 52c1c195..c9a6a98d 100644 --- a/cmd/frpc/sub/status.go +++ b/cmd/frpc/sub/status.go @@ -23,11 +23,11 @@ import ( "os" "strings" - "github.com/fatedier/frp/client" - "github.com/fatedier/frp/pkg/config" - "github.com/rodaine/table" "github.com/spf13/cobra" + + "github.com/fatedier/frp/client" + "github.com/fatedier/frp/pkg/config" ) func init() { diff --git a/cmd/frpc/sub/stcp.go b/cmd/frpc/sub/stcp.go index 45f01e59..989387bb 100644 --- a/cmd/frpc/sub/stcp.go +++ b/cmd/frpc/sub/stcp.go @@ -18,10 +18,10 @@ import ( "fmt" "os" + "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/consts" - - "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frpc/sub/sudp.go b/cmd/frpc/sub/sudp.go index 45c5ad61..c781223d 100644 --- a/cmd/frpc/sub/sudp.go +++ b/cmd/frpc/sub/sudp.go @@ -18,10 +18,10 @@ import ( "fmt" "os" + "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/consts" - - "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frpc/sub/udp.go b/cmd/frpc/sub/udp.go index 2ce4327e..984ad068 100644 --- a/cmd/frpc/sub/udp.go +++ b/cmd/frpc/sub/udp.go @@ -18,10 +18,10 @@ import ( "fmt" "os" + "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/consts" - - "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frpc/sub/verify.go b/cmd/frpc/sub/verify.go index 76872b90..c86b1e82 100644 --- a/cmd/frpc/sub/verify.go +++ b/cmd/frpc/sub/verify.go @@ -18,9 +18,9 @@ import ( "fmt" "os" - "github.com/fatedier/frp/pkg/config" - "github.com/spf13/cobra" + + "github.com/fatedier/frp/pkg/config" ) func init() { diff --git a/cmd/frpc/sub/xtcp.go b/cmd/frpc/sub/xtcp.go index 6c6c7d84..069cce7e 100644 --- a/cmd/frpc/sub/xtcp.go +++ b/cmd/frpc/sub/xtcp.go @@ -18,10 +18,10 @@ import ( "fmt" "os" + "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/consts" - - "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frps/root.go b/cmd/frps/root.go index cdf92672..62899347 100644 --- a/cmd/frps/root.go +++ b/cmd/frps/root.go @@ -18,14 +18,14 @@ import ( "fmt" "os" + "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/auth" "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/pkg/util/util" "github.com/fatedier/frp/pkg/util/version" "github.com/fatedier/frp/server" - - "github.com/spf13/cobra" ) const ( diff --git a/cmd/frps/verify.go b/cmd/frps/verify.go index 35b2acdf..42f2ca74 100644 --- a/cmd/frps/verify.go +++ b/cmd/frps/verify.go @@ -18,9 +18,9 @@ import ( "fmt" "os" - "github.com/fatedier/frp/pkg/config" - "github.com/spf13/cobra" + + "github.com/fatedier/frp/pkg/config" ) func init() { diff --git a/pkg/auth/oidc.go b/pkg/auth/oidc.go index ff8e54cc..831180f4 100644 --- a/pkg/auth/oidc.go +++ b/pkg/auth/oidc.go @@ -18,10 +18,10 @@ import ( "context" "fmt" - "github.com/fatedier/frp/pkg/msg" - "github.com/coreos/go-oidc" "golang.org/x/oauth2/clientcredentials" + + "github.com/fatedier/frp/pkg/msg" ) type OidcClientConfig struct { diff --git a/pkg/config/client.go b/pkg/config/client.go index 23ac2978..0cefc21c 100644 --- a/pkg/config/client.go +++ b/pkg/config/client.go @@ -20,10 +20,10 @@ import ( "path/filepath" "strings" + "gopkg.in/ini.v1" + "github.com/fatedier/frp/pkg/auth" "github.com/fatedier/frp/pkg/util/util" - - "gopkg.in/ini.v1" ) // ClientCommonConf contains information for a client service. It is diff --git a/pkg/config/client_test.go b/pkg/config/client_test.go index a64b9ee7..af268dd6 100644 --- a/pkg/config/client_test.go +++ b/pkg/config/client_test.go @@ -17,10 +17,10 @@ package config import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/fatedier/frp/pkg/auth" "github.com/fatedier/frp/pkg/consts" - - "github.com/stretchr/testify/assert" ) const ( diff --git a/pkg/config/proxy.go b/pkg/config/proxy.go index c000bb30..b3932065 100644 --- a/pkg/config/proxy.go +++ b/pkg/config/proxy.go @@ -19,10 +19,10 @@ import ( "reflect" "strings" + "gopkg.in/ini.v1" + "github.com/fatedier/frp/pkg/consts" "github.com/fatedier/frp/pkg/msg" - - "gopkg.in/ini.v1" ) // Proxy diff --git a/pkg/config/proxy_test.go b/pkg/config/proxy_test.go index 68c87b95..f4a2929f 100644 --- a/pkg/config/proxy_test.go +++ b/pkg/config/proxy_test.go @@ -17,10 +17,10 @@ package config import ( "testing" - "github.com/fatedier/frp/pkg/consts" "github.com/stretchr/testify/assert" - "gopkg.in/ini.v1" + + "github.com/fatedier/frp/pkg/consts" ) var ( diff --git a/pkg/config/server.go b/pkg/config/server.go index e4f5a498..7bd55f6b 100644 --- a/pkg/config/server.go +++ b/pkg/config/server.go @@ -18,12 +18,12 @@ import ( "fmt" "strings" + "github.com/go-playground/validator/v10" + "gopkg.in/ini.v1" + "github.com/fatedier/frp/pkg/auth" plugin "github.com/fatedier/frp/pkg/plugin/server" "github.com/fatedier/frp/pkg/util/util" - - "github.com/go-playground/validator/v10" - "gopkg.in/ini.v1" ) // ServerCommonConf contains information for a server service. It is diff --git a/pkg/config/server_test.go b/pkg/config/server_test.go index 8f19c38e..f26296f8 100644 --- a/pkg/config/server_test.go +++ b/pkg/config/server_test.go @@ -17,10 +17,10 @@ package config import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/fatedier/frp/pkg/auth" plugin "github.com/fatedier/frp/pkg/plugin/server" - - "github.com/stretchr/testify/assert" ) func Test_LoadServerCommonConf(t *testing.T) { diff --git a/pkg/config/visitor.go b/pkg/config/visitor.go index aede14d8..4f49ac37 100644 --- a/pkg/config/visitor.go +++ b/pkg/config/visitor.go @@ -18,9 +18,9 @@ import ( "fmt" "reflect" - "github.com/fatedier/frp/pkg/consts" - "gopkg.in/ini.v1" + + "github.com/fatedier/frp/pkg/consts" ) // Visitor diff --git a/pkg/config/visitor_test.go b/pkg/config/visitor_test.go index ce200ed0..cdfbbf46 100644 --- a/pkg/config/visitor_test.go +++ b/pkg/config/visitor_test.go @@ -17,10 +17,10 @@ package config import ( "testing" - "github.com/fatedier/frp/pkg/consts" - "github.com/stretchr/testify/assert" "gopkg.in/ini.v1" + + "github.com/fatedier/frp/pkg/consts" ) const testVisitorPrefix = "test." diff --git a/pkg/metrics/prometheus/server.go b/pkg/metrics/prometheus/server.go index 9cfdfda6..19eceb72 100644 --- a/pkg/metrics/prometheus/server.go +++ b/pkg/metrics/prometheus/server.go @@ -1,9 +1,9 @@ package prometheus import ( - "github.com/fatedier/frp/server/metrics" - "github.com/prometheus/client_golang/prometheus" + + "github.com/fatedier/frp/server/metrics" ) const ( diff --git a/pkg/nathole/nathole.go b/pkg/nathole/nathole.go index 545ad7aa..6a5f2efb 100644 --- a/pkg/nathole/nathole.go +++ b/pkg/nathole/nathole.go @@ -7,12 +7,12 @@ import ( "sync" "time" + "github.com/fatedier/golib/errors" + "github.com/fatedier/golib/pool" + "github.com/fatedier/frp/pkg/msg" "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/pkg/util/util" - - "github.com/fatedier/golib/errors" - "github.com/fatedier/golib/pool" ) // Timeout seconds. diff --git a/pkg/plugin/client/http_proxy.go b/pkg/plugin/client/http_proxy.go index 45bd3a9a..669dd618 100644 --- a/pkg/plugin/client/http_proxy.go +++ b/pkg/plugin/client/http_proxy.go @@ -22,10 +22,10 @@ import ( "net/http" "strings" - frpNet "github.com/fatedier/frp/pkg/util/net" - frpIo "github.com/fatedier/golib/io" gnet "github.com/fatedier/golib/net" + + frpNet "github.com/fatedier/frp/pkg/util/net" ) const PluginHTTPProxy = "http_proxy" diff --git a/pkg/plugin/client/socks5.go b/pkg/plugin/client/socks5.go index 3a543d9d..d9573f75 100644 --- a/pkg/plugin/client/socks5.go +++ b/pkg/plugin/client/socks5.go @@ -19,9 +19,9 @@ import ( "log" "net" - frpNet "github.com/fatedier/frp/pkg/util/net" - gosocks5 "github.com/armon/go-socks5" + + frpNet "github.com/fatedier/frp/pkg/util/net" ) const PluginSocks5 = "socks5" diff --git a/pkg/plugin/client/static_file.go b/pkg/plugin/client/static_file.go index 1eeea3ba..3b8a07ed 100644 --- a/pkg/plugin/client/static_file.go +++ b/pkg/plugin/client/static_file.go @@ -19,9 +19,9 @@ import ( "net" "net/http" - frpNet "github.com/fatedier/frp/pkg/util/net" - "github.com/gorilla/mux" + + frpNet "github.com/fatedier/frp/pkg/util/net" ) const PluginStaticFile = "static_file" diff --git a/pkg/proto/udp/udp.go b/pkg/proto/udp/udp.go index 97f6ea40..5c0e1ad0 100644 --- a/pkg/proto/udp/udp.go +++ b/pkg/proto/udp/udp.go @@ -20,10 +20,10 @@ import ( "sync" "time" - "github.com/fatedier/frp/pkg/msg" - "github.com/fatedier/golib/errors" "github.com/fatedier/golib/pool" + + "github.com/fatedier/frp/pkg/msg" ) func NewUDPPacket(buf []byte, laddr, raddr *net.UDPAddr) *msg.UDPPacket { diff --git a/pkg/util/vhost/http.go b/pkg/util/vhost/http.go index b9dc32db..dfad691d 100644 --- a/pkg/util/vhost/http.go +++ b/pkg/util/vhost/http.go @@ -26,10 +26,10 @@ import ( "strings" "time" + "github.com/fatedier/golib/pool" + frpLog "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/pkg/util/util" - - "github.com/fatedier/golib/pool" ) var ( diff --git a/pkg/util/vhost/vhost.go b/pkg/util/vhost/vhost.go index 4239d113..ae86cd2f 100644 --- a/pkg/util/vhost/vhost.go +++ b/pkg/util/vhost/vhost.go @@ -19,11 +19,11 @@ import ( "strings" "time" + "github.com/fatedier/golib/errors" + "github.com/fatedier/frp/pkg/util/log" frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/fatedier/frp/pkg/util/xlog" - - "github.com/fatedier/golib/errors" ) type RouteInfo string diff --git a/server/control.go b/server/control.go index 78d42aa6..3bf9743c 100644 --- a/server/control.go +++ b/server/control.go @@ -23,6 +23,10 @@ import ( "sync" "time" + "github.com/fatedier/golib/control/shutdown" + "github.com/fatedier/golib/crypto" + "github.com/fatedier/golib/errors" + "github.com/fatedier/frp/pkg/auth" "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/consts" @@ -35,10 +39,6 @@ import ( "github.com/fatedier/frp/server/controller" "github.com/fatedier/frp/server/metrics" "github.com/fatedier/frp/server/proxy" - - "github.com/fatedier/golib/control/shutdown" - "github.com/fatedier/golib/crypto" - "github.com/fatedier/golib/errors" ) type ControlManager struct { diff --git a/server/dashboard.go b/server/dashboard.go index 8ae1ea86..d29244a0 100644 --- a/server/dashboard.go +++ b/server/dashboard.go @@ -20,11 +20,11 @@ import ( "net/http/pprof" "time" - "github.com/fatedier/frp/assets" - frpNet "github.com/fatedier/frp/pkg/util/net" - "github.com/gorilla/mux" "github.com/prometheus/client_golang/prometheus/promhttp" + + "github.com/fatedier/frp/assets" + frpNet "github.com/fatedier/frp/pkg/util/net" ) var ( diff --git a/server/dashboard_api.go b/server/dashboard_api.go index 7d159c7a..f4f48a25 100644 --- a/server/dashboard_api.go +++ b/server/dashboard_api.go @@ -18,13 +18,13 @@ import ( "encoding/json" "net/http" + "github.com/gorilla/mux" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/consts" "github.com/fatedier/frp/pkg/metrics/mem" "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/pkg/util/version" - - "github.com/gorilla/mux" ) type GeneralResponse struct { diff --git a/server/group/tcp.go b/server/group/tcp.go index c7fd2b27..c5677493 100644 --- a/server/group/tcp.go +++ b/server/group/tcp.go @@ -19,9 +19,9 @@ import ( "strconv" "sync" - "github.com/fatedier/frp/server/ports" - gerr "github.com/fatedier/golib/errors" + + "github.com/fatedier/frp/server/ports" ) // TCPGroupCtl manage all TCPGroups diff --git a/server/group/tcpmux.go b/server/group/tcpmux.go index f2db8def..5f8d672b 100644 --- a/server/group/tcpmux.go +++ b/server/group/tcpmux.go @@ -20,11 +20,11 @@ import ( "net" "sync" + gerr "github.com/fatedier/golib/errors" + "github.com/fatedier/frp/pkg/consts" "github.com/fatedier/frp/pkg/util/tcpmux" "github.com/fatedier/frp/pkg/util/vhost" - - gerr "github.com/fatedier/golib/errors" ) // TCPMuxGroupCtl manage all TCPMuxGroups diff --git a/server/proxy/http.go b/server/proxy/http.go index 86925281..47a28661 100644 --- a/server/proxy/http.go +++ b/server/proxy/http.go @@ -19,13 +19,13 @@ import ( "net" "strings" + frpIo "github.com/fatedier/golib/io" + "github.com/fatedier/frp/pkg/config" frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/fatedier/frp/pkg/util/util" "github.com/fatedier/frp/pkg/util/vhost" "github.com/fatedier/frp/server/metrics" - - frpIo "github.com/fatedier/golib/io" ) type HTTPProxy struct { diff --git a/server/proxy/proxy.go b/server/proxy/proxy.go index 43c2c74e..8f4666d2 100644 --- a/server/proxy/proxy.go +++ b/server/proxy/proxy.go @@ -23,6 +23,8 @@ import ( "sync" "time" + frpIo "github.com/fatedier/golib/io" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/msg" plugin "github.com/fatedier/frp/pkg/plugin/server" @@ -30,8 +32,6 @@ import ( "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/frp/server/controller" "github.com/fatedier/frp/server/metrics" - - frpIo "github.com/fatedier/golib/io" ) type GetWorkConnFn func() (net.Conn, error) diff --git a/server/proxy/udp.go b/server/proxy/udp.go index 9e3c0675..97ddbc25 100644 --- a/server/proxy/udp.go +++ b/server/proxy/udp.go @@ -22,14 +22,14 @@ import ( "strconv" "time" + "github.com/fatedier/golib/errors" + frpIo "github.com/fatedier/golib/io" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/msg" "github.com/fatedier/frp/pkg/proto/udp" frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/fatedier/frp/server/metrics" - - "github.com/fatedier/golib/errors" - frpIo "github.com/fatedier/golib/io" ) type UDPProxy struct { diff --git a/server/proxy/xtcp.go b/server/proxy/xtcp.go index 317a3d48..a60edc78 100644 --- a/server/proxy/xtcp.go +++ b/server/proxy/xtcp.go @@ -17,10 +17,10 @@ package proxy import ( "fmt" + "github.com/fatedier/golib/errors" + "github.com/fatedier/frp/pkg/config" "github.com/fatedier/frp/pkg/msg" - - "github.com/fatedier/golib/errors" ) type XTCPProxy struct { diff --git a/server/service.go b/server/service.go index c3c45488..413e105f 100644 --- a/server/service.go +++ b/server/service.go @@ -26,6 +26,9 @@ import ( "strconv" "time" + "github.com/fatedier/golib/net/mux" + fmux "github.com/hashicorp/yamux" + "github.com/fatedier/frp/assets" "github.com/fatedier/frp/pkg/auth" "github.com/fatedier/frp/pkg/config" @@ -47,9 +50,6 @@ import ( "github.com/fatedier/frp/server/ports" "github.com/fatedier/frp/server/proxy" "github.com/fatedier/frp/server/visitor" - - "github.com/fatedier/golib/net/mux" - fmux "github.com/hashicorp/yamux" ) const ( diff --git a/server/visitor/visitor.go b/server/visitor/visitor.go index 4796b416..009326ba 100644 --- a/server/visitor/visitor.go +++ b/server/visitor/visitor.go @@ -20,10 +20,10 @@ import ( "net" "sync" + frpIo "github.com/fatedier/golib/io" + frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/fatedier/frp/pkg/util/util" - - frpIo "github.com/fatedier/golib/io" ) // Manager for visitor listeners. diff --git a/test/e2e/basic/basic.go b/test/e2e/basic/basic.go index 13f17168..7d7d9b65 100644 --- a/test/e2e/basic/basic.go +++ b/test/e2e/basic/basic.go @@ -5,6 +5,8 @@ import ( "fmt" "strings" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/pkg/transport" "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" @@ -12,8 +14,6 @@ import ( "github.com/fatedier/frp/test/e2e/mock/server/streamserver" "github.com/fatedier/frp/test/e2e/pkg/port" "github.com/fatedier/frp/test/e2e/pkg/request" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: Basic]", func() { diff --git a/test/e2e/basic/client.go b/test/e2e/basic/client.go index 8d370928..4ca8f15f 100644 --- a/test/e2e/basic/client.go +++ b/test/e2e/basic/client.go @@ -6,12 +6,12 @@ import ( "strings" "time" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" "github.com/fatedier/frp/test/e2e/pkg/request" clientsdk "github.com/fatedier/frp/test/e2e/pkg/sdk/client" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: ClientManage]", func() { diff --git a/test/e2e/basic/client_server.go b/test/e2e/basic/client_server.go index c19077c4..c90dc338 100644 --- a/test/e2e/basic/client_server.go +++ b/test/e2e/basic/client_server.go @@ -4,12 +4,12 @@ import ( "fmt" "strings" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" "github.com/fatedier/frp/test/e2e/pkg/cert" "github.com/fatedier/frp/test/e2e/pkg/port" - - . "github.com/onsi/ginkgo" ) type generalTestConfigures struct { diff --git a/test/e2e/basic/cmd.go b/test/e2e/basic/cmd.go index 562310fd..7d57618a 100644 --- a/test/e2e/basic/cmd.go +++ b/test/e2e/basic/cmd.go @@ -5,10 +5,10 @@ import ( "strconv" "strings" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/pkg/request" - - . "github.com/onsi/ginkgo" ) const ( diff --git a/test/e2e/basic/config.go b/test/e2e/basic/config.go index d21bc57c..7037418d 100644 --- a/test/e2e/basic/config.go +++ b/test/e2e/basic/config.go @@ -3,11 +3,11 @@ package basic import ( "fmt" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" "github.com/fatedier/frp/test/e2e/pkg/port" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: Config]", func() { diff --git a/test/e2e/basic/http.go b/test/e2e/basic/http.go index b8cb448c..1d758d63 100644 --- a/test/e2e/basic/http.go +++ b/test/e2e/basic/http.go @@ -6,14 +6,14 @@ import ( "net/url" "strconv" + "github.com/gorilla/websocket" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" "github.com/fatedier/frp/test/e2e/mock/server/httpserver" "github.com/fatedier/frp/test/e2e/pkg/request" "github.com/fatedier/frp/test/e2e/pkg/utils" - - "github.com/gorilla/websocket" - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: HTTP]", func() { diff --git a/test/e2e/basic/server.go b/test/e2e/basic/server.go index 74b421be..20752367 100644 --- a/test/e2e/basic/server.go +++ b/test/e2e/basic/server.go @@ -5,13 +5,13 @@ import ( "net" "strconv" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" "github.com/fatedier/frp/test/e2e/pkg/port" "github.com/fatedier/frp/test/e2e/pkg/request" clientsdk "github.com/fatedier/frp/test/e2e/pkg/sdk/client" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: Server Manager]", func() { diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index b392954b..6b0d3e01 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -3,12 +3,12 @@ package e2e import ( "testing" - "github.com/fatedier/frp/pkg/util/log" - "github.com/fatedier/frp/test/e2e/framework" - "github.com/onsi/ginkgo" "github.com/onsi/ginkgo/config" "github.com/onsi/gomega" + + "github.com/fatedier/frp/pkg/util/log" + "github.com/fatedier/frp/test/e2e/framework" ) var _ = ginkgo.SynchronizedBeforeSuite(func() []byte { diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 2dddb952..3e89f5ed 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -6,15 +6,13 @@ import ( "os" "testing" - "github.com/fatedier/frp/pkg/util/log" - "github.com/fatedier/frp/test/e2e/framework" + _ "github.com/onsi/ginkgo" - // test source + "github.com/fatedier/frp/pkg/util/log" _ "github.com/fatedier/frp/test/e2e/basic" _ "github.com/fatedier/frp/test/e2e/features" + "github.com/fatedier/frp/test/e2e/framework" _ "github.com/fatedier/frp/test/e2e/plugin" - - _ "github.com/onsi/ginkgo" ) // handleFlags sets up all flags and parses the command line. diff --git a/test/e2e/examples.go b/test/e2e/examples.go index 6423aec1..0f416bd6 100644 --- a/test/e2e/examples.go +++ b/test/e2e/examples.go @@ -3,10 +3,10 @@ package e2e import ( "fmt" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: Example]", func() { diff --git a/test/e2e/features/bandwidth_limit.go b/test/e2e/features/bandwidth_limit.go index f984fdb9..3c2b80e6 100644 --- a/test/e2e/features/bandwidth_limit.go +++ b/test/e2e/features/bandwidth_limit.go @@ -5,12 +5,12 @@ import ( "strings" "time" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" "github.com/fatedier/frp/test/e2e/mock/server/streamserver" "github.com/fatedier/frp/test/e2e/pkg/request" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: Bandwidth Limit]", func() { diff --git a/test/e2e/features/chaos.go b/test/e2e/features/chaos.go index 2049fc77..77f3a16f 100644 --- a/test/e2e/features/chaos.go +++ b/test/e2e/features/chaos.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "github.com/fatedier/frp/test/e2e/framework" - . "github.com/onsi/ginkgo" + + "github.com/fatedier/frp/test/e2e/framework" ) var _ = Describe("[Feature: Chaos]", func() { diff --git a/test/e2e/features/group.go b/test/e2e/features/group.go index ea6b781f..3d0dbe5d 100644 --- a/test/e2e/features/group.go +++ b/test/e2e/features/group.go @@ -6,13 +6,13 @@ import ( "sync" "time" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" "github.com/fatedier/frp/test/e2e/mock/server/httpserver" "github.com/fatedier/frp/test/e2e/mock/server/streamserver" "github.com/fatedier/frp/test/e2e/pkg/request" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: Group]", func() { diff --git a/test/e2e/features/heartbeat.go b/test/e2e/features/heartbeat.go index b0732c37..db84155b 100644 --- a/test/e2e/features/heartbeat.go +++ b/test/e2e/features/heartbeat.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "github.com/fatedier/frp/test/e2e/framework" - . "github.com/onsi/ginkgo" + + "github.com/fatedier/frp/test/e2e/framework" ) var _ = Describe("[Feature: Heartbeat]", func() { diff --git a/test/e2e/features/monitor.go b/test/e2e/features/monitor.go index d8b656a8..024824ed 100644 --- a/test/e2e/features/monitor.go +++ b/test/e2e/features/monitor.go @@ -5,12 +5,12 @@ import ( "strings" "time" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" "github.com/fatedier/frp/test/e2e/pkg/request" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: Monitor]", func() { diff --git a/test/e2e/features/real_ip.go b/test/e2e/features/real_ip.go index 424d4049..1ceb1865 100644 --- a/test/e2e/features/real_ip.go +++ b/test/e2e/features/real_ip.go @@ -6,6 +6,9 @@ import ( "net" "net/http" + . "github.com/onsi/ginkgo" + pp "github.com/pires/go-proxyproto" + "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" @@ -13,9 +16,6 @@ import ( "github.com/fatedier/frp/test/e2e/mock/server/streamserver" "github.com/fatedier/frp/test/e2e/pkg/request" "github.com/fatedier/frp/test/e2e/pkg/rpc" - - . "github.com/onsi/ginkgo" - pp "github.com/pires/go-proxyproto" ) var _ = Describe("[Feature: Real IP]", func() { diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 344f64c3..dca88ade 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -9,12 +9,12 @@ import ( "strings" "text/template" + "github.com/onsi/ginkgo" + "github.com/onsi/ginkgo/config" + "github.com/fatedier/frp/test/e2e/mock/server" "github.com/fatedier/frp/test/e2e/pkg/port" "github.com/fatedier/frp/test/e2e/pkg/process" - - "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/config" ) type Options struct { diff --git a/test/e2e/pkg/request/request.go b/test/e2e/pkg/request/request.go index 939c8268..c0ded045 100644 --- a/test/e2e/pkg/request/request.go +++ b/test/e2e/pkg/request/request.go @@ -12,8 +12,9 @@ import ( "strconv" "time" - "github.com/fatedier/frp/test/e2e/pkg/rpc" libdial "github.com/fatedier/golib/net/dial" + + "github.com/fatedier/frp/test/e2e/pkg/rpc" ) type Request struct { diff --git a/test/e2e/plugin/client.go b/test/e2e/plugin/client.go index 03908956..57ef8ffb 100644 --- a/test/e2e/plugin/client.go +++ b/test/e2e/plugin/client.go @@ -5,6 +5,8 @@ import ( "fmt" "strconv" + . "github.com/onsi/ginkgo" + "github.com/fatedier/frp/pkg/transport" "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" @@ -13,8 +15,6 @@ import ( "github.com/fatedier/frp/test/e2e/pkg/port" "github.com/fatedier/frp/test/e2e/pkg/request" "github.com/fatedier/frp/test/e2e/pkg/utils" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: Client-Plugins]", func() { diff --git a/test/e2e/plugin/server.go b/test/e2e/plugin/server.go index d12034cb..041415df 100644 --- a/test/e2e/plugin/server.go +++ b/test/e2e/plugin/server.go @@ -4,12 +4,12 @@ import ( "fmt" "time" + . "github.com/onsi/ginkgo" + plugin "github.com/fatedier/frp/pkg/plugin/server" "github.com/fatedier/frp/pkg/transport" "github.com/fatedier/frp/test/e2e/framework" "github.com/fatedier/frp/test/e2e/framework/consts" - - . "github.com/onsi/ginkgo" ) var _ = Describe("[Feature: Server-Plugins]", func() {