From 4eb3acb4ddff44f964473440e336baed502c8643 Mon Sep 17 00:00:00 2001 From: JimhHan <50871214+JimhHan@users.noreply.github.com> Date: Fri, 26 Mar 2021 17:30:24 +0800 Subject: [PATCH] Fix: format --- common/matcher/domain/matcher.go | 3 ++- common/matcher/geoip/conf.go | 5 ++--- common/session/session.go | 4 ++-- infra/conf/dns.go | 5 +++-- infra/conf/http.go | 2 +- infra/conf/router.go | 2 +- infra/conf/shadowsocks.go | 2 +- infra/conf/socks.go | 2 +- infra/conf/transport_authenticators.go | 2 +- infra/conf/transport_internet.go | 2 +- infra/conf/trojan.go | 2 +- infra/conf/vless.go | 2 +- infra/conf/vmess.go | 2 +- infra/conf/xray.go | 11 ++++++----- 14 files changed, 24 insertions(+), 22 deletions(-) diff --git a/common/matcher/domain/matcher.go b/common/matcher/domain/matcher.go index 47425343..1abad45c 100644 --- a/common/matcher/domain/matcher.go +++ b/common/matcher/domain/matcher.go @@ -1,9 +1,10 @@ package domain import ( + "strings" + "github.com/xtls/xray-core/common/matcher/str" "github.com/xtls/xray-core/features/routing" - "strings" ) var matcherTypeMap = map[MatchingType]str.Type{ diff --git a/common/matcher/geoip/conf.go b/common/matcher/geoip/conf.go index c2c9b8cb..e7d89ac6 100644 --- a/common/matcher/geoip/conf.go +++ b/common/matcher/geoip/conf.go @@ -1,13 +1,12 @@ package geoip import ( - "github.com/xtls/xray-core/common/net" - "github.com/xtls/xray-core/infra/conf/common" "runtime" "strconv" "strings" "github.com/golang/protobuf/proto" + "github.com/xtls/xray-core/common/net" "github.com/xtls/xray-core/common/platform/filesystem" ) @@ -93,7 +92,7 @@ func find(data, code []byte) []byte { } } -func ParaseIPList(ips common.StringList) ([]*GeoIP, error) { +func ParaseIPList(ips []string) ([]*GeoIP, error) { var geoipList []*GeoIP var customCidrs []*CIDR diff --git a/common/session/session.go b/common/session/session.go index 7c7062aa..9b32773f 100644 --- a/common/session/session.go +++ b/common/session/session.go @@ -3,11 +3,11 @@ package session // import "github.com/xtls/xray-core/common/session" import ( "context" - "github.com/xtls/xray-core/common/matcher/domain" - "github.com/xtls/xray-core/common/matcher/geoip" "math/rand" "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/matcher/domain" + "github.com/xtls/xray-core/common/matcher/geoip" "github.com/xtls/xray-core/common/net" "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/signal" diff --git a/infra/conf/dns.go b/infra/conf/dns.go index 807600ec..9a70e3e8 100644 --- a/infra/conf/dns.go +++ b/infra/conf/dns.go @@ -2,16 +2,17 @@ package conf import ( "encoding/json" - "github.com/xtls/xray-core/common/matcher/geoip" - "github.com/xtls/xray-core/infra/conf/common" + "sort" "strings" "github.com/xtls/xray-core/app/dns" dm "github.com/xtls/xray-core/common/matcher/domain" "github.com/xtls/xray-core/common/matcher/domain/conf" + "github.com/xtls/xray-core/common/matcher/geoip" "github.com/xtls/xray-core/common/matcher/geosite" "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/infra/conf/common" ) type NameServerConfig struct { diff --git a/infra/conf/http.go b/infra/conf/http.go index 7b9acaa7..ebaaa7fd 100644 --- a/infra/conf/http.go +++ b/infra/conf/http.go @@ -2,11 +2,11 @@ package conf import ( "encoding/json" - "github.com/xtls/xray-core/infra/conf/common" "github.com/golang/protobuf/proto" "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/infra/conf/common" "github.com/xtls/xray-core/proxy/http" ) diff --git a/infra/conf/router.go b/infra/conf/router.go index 1f68e304..50463267 100644 --- a/infra/conf/router.go +++ b/infra/conf/router.go @@ -2,7 +2,6 @@ package conf import ( "encoding/json" - "github.com/xtls/xray-core/infra/conf/common" "strconv" "strings" @@ -11,6 +10,7 @@ import ( "github.com/xtls/xray-core/common/matcher/geoip" "github.com/xtls/xray-core/common/matcher/geosite" "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/infra/conf/common" ) type RouterRulesConfig struct { diff --git a/infra/conf/shadowsocks.go b/infra/conf/shadowsocks.go index 42b9f038..f5b4305d 100644 --- a/infra/conf/shadowsocks.go +++ b/infra/conf/shadowsocks.go @@ -1,13 +1,13 @@ package conf import ( - "github.com/xtls/xray-core/infra/conf/common" "strings" "github.com/golang/protobuf/proto" "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/infra/conf/common" "github.com/xtls/xray-core/proxy/shadowsocks" ) diff --git a/infra/conf/socks.go b/infra/conf/socks.go index ea2a4189..61d8295e 100644 --- a/infra/conf/socks.go +++ b/infra/conf/socks.go @@ -2,11 +2,11 @@ package conf import ( "encoding/json" - "github.com/xtls/xray-core/infra/conf/common" "github.com/golang/protobuf/proto" "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/infra/conf/common" "github.com/xtls/xray-core/proxy/socks" ) diff --git a/infra/conf/transport_authenticators.go b/infra/conf/transport_authenticators.go index f000e8d4..f0ddffe3 100644 --- a/infra/conf/transport_authenticators.go +++ b/infra/conf/transport_authenticators.go @@ -1,11 +1,11 @@ package conf import ( - "github.com/xtls/xray-core/infra/conf/common" "sort" "github.com/golang/protobuf/proto" + "github.com/xtls/xray-core/infra/conf/common" "github.com/xtls/xray-core/transport/internet/headers/http" "github.com/xtls/xray-core/transport/internet/headers/noop" "github.com/xtls/xray-core/transport/internet/headers/srtp" diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index 980a49a8..9e929e97 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -2,7 +2,6 @@ package conf import ( "encoding/json" - "github.com/xtls/xray-core/infra/conf/common" "math" "net/url" "strconv" @@ -12,6 +11,7 @@ import ( "github.com/xtls/xray-core/common/platform/filesystem" "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/infra/conf/common" "github.com/xtls/xray-core/transport/internet" "github.com/xtls/xray-core/transport/internet/domainsocket" "github.com/xtls/xray-core/transport/internet/http" diff --git a/infra/conf/trojan.go b/infra/conf/trojan.go index b59894cb..0a71e243 100644 --- a/infra/conf/trojan.go +++ b/infra/conf/trojan.go @@ -2,7 +2,6 @@ package conf import ( "encoding/json" - "github.com/xtls/xray-core/infra/conf/common" "runtime" "strconv" "syscall" @@ -12,6 +11,7 @@ import ( "github.com/xtls/xray-core/common/net" "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/infra/conf/common" "github.com/xtls/xray-core/proxy/trojan" ) diff --git a/infra/conf/vless.go b/infra/conf/vless.go index 33a5c3b1..c7a07fb2 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -2,7 +2,6 @@ package conf import ( "encoding/json" - "github.com/xtls/xray-core/infra/conf/common" "runtime" "strconv" "syscall" @@ -13,6 +12,7 @@ import ( "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/serial" "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/infra/conf/common" "github.com/xtls/xray-core/proxy/vless" "github.com/xtls/xray-core/proxy/vless/inbound" "github.com/xtls/xray-core/proxy/vless/outbound" diff --git a/infra/conf/vmess.go b/infra/conf/vmess.go index 62084c09..9670dc29 100644 --- a/infra/conf/vmess.go +++ b/infra/conf/vmess.go @@ -2,7 +2,6 @@ package conf import ( "encoding/json" - "github.com/xtls/xray-core/infra/conf/common" "strings" "github.com/golang/protobuf/proto" @@ -10,6 +9,7 @@ import ( "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/serial" "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/infra/conf/common" "github.com/xtls/xray-core/proxy/vmess" "github.com/xtls/xray-core/proxy/vmess/inbound" "github.com/xtls/xray-core/proxy/vmess/outbound" diff --git a/infra/conf/xray.go b/infra/conf/xray.go index f8712221..02561c5e 100644 --- a/infra/conf/xray.go +++ b/infra/conf/xray.go @@ -2,11 +2,7 @@ package conf import ( "encoding/json" - "github.com/xtls/xray-core/common/matcher/domain" - "github.com/xtls/xray-core/common/matcher/domain/conf" - "github.com/xtls/xray-core/common/matcher/geoip" - "github.com/xtls/xray-core/infra/conf/common" - "github.com/xtls/xray-core/transport/internet" + "log" "os" "strings" @@ -14,8 +10,13 @@ import ( "github.com/xtls/xray-core/app/dispatcher" "github.com/xtls/xray-core/app/proxyman" "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common/matcher/domain" + "github.com/xtls/xray-core/common/matcher/domain/conf" + "github.com/xtls/xray-core/common/matcher/geoip" "github.com/xtls/xray-core/common/serial" core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/infra/conf/common" + "github.com/xtls/xray-core/transport/internet" "github.com/xtls/xray-core/transport/internet/xtls" )