Browse Source

code style

loyalsoldier 4 years ago
parent
commit
2bdc86049a

+ 1 - 2
infra/conf/cfgcommon/common_test.go

@@ -5,14 +5,13 @@ import (
 	"os"
 	"os"
 	"testing"
 	"testing"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	"github.com/google/go-cmp/cmp"
 	"github.com/google/go-cmp/cmp"
 	"github.com/google/go-cmp/cmp/cmpopts"
 	"github.com/google/go-cmp/cmp/cmpopts"
 
 
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 )
 )
 
 
 func TestStringListUnmarshalError(t *testing.T) {
 func TestStringListUnmarshalError(t *testing.T) {

+ 3 - 5
infra/conf/dns.go

@@ -6,15 +6,13 @@ import (
 	"sort"
 	"sort"
 	"strings"
 	"strings"
 
 
+	"github.com/v2fly/v2ray-core/v4/app/dns"
+	"github.com/v2fly/v2ray-core/v4/app/router"
+	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
-
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 	rule2 "github.com/v2fly/v2ray-core/v4/infra/conf/rule"
 	rule2 "github.com/v2fly/v2ray-core/v4/infra/conf/rule"
-
-	"github.com/v2fly/v2ray-core/v4/app/dns"
-	"github.com/v2fly/v2ray-core/v4/app/router"
-	"github.com/v2fly/v2ray-core/v4/common/net"
 )
 )
 
 
 type NameServerConfig struct {
 type NameServerConfig struct {

+ 1 - 1
infra/conf/dns_proxy.go

@@ -2,9 +2,9 @@ package conf
 
 
 import (
 import (
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/proxy/dns"
 	"github.com/v2fly/v2ray-core/v4/proxy/dns"
 )
 )
 
 

+ 0 - 1
infra/conf/dns_test.go

@@ -15,7 +15,6 @@ import (
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/infra/conf"
 	"github.com/v2fly/v2ray-core/v4/infra/conf"
-
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
 )
 )
 
 

+ 1 - 1
infra/conf/dokodemo.go

@@ -2,8 +2,8 @@ package conf
 
 
 import (
 import (
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 
 
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/proxy/dokodemo"
 	"github.com/v2fly/v2ray-core/v4/proxy/dokodemo"
 )
 )
 
 

+ 2 - 1
infra/conf/geodata/memconservative/cache.go

@@ -4,9 +4,10 @@ import (
 	"io/ioutil"
 	"io/ioutil"
 	"strings"
 	"strings"
 
 
+	"google.golang.org/protobuf/proto"
+
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
-	"google.golang.org/protobuf/proto"
 )
 )
 
 
 type GeoIPCache map[string]*router.GeoIP
 type GeoIPCache map[string]*router.GeoIP

+ 2 - 1
infra/conf/geodata/memconservative/decode.go

@@ -5,8 +5,9 @@ import (
 	"io"
 	"io"
 	"strings"
 	"strings"
 
 
-	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 	"google.golang.org/protobuf/encoding/protowire"
 	"google.golang.org/protobuf/encoding/protowire"
+
+	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 )
 )
 
 
 var (
 var (

+ 1 - 2
infra/conf/geodata/standard/standard.go

@@ -3,12 +3,11 @@ package standard
 import (
 import (
 	"strings"
 	"strings"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
-
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 )
 )
 
 
 //go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
 //go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen

+ 1 - 2
infra/conf/http.go

@@ -3,12 +3,11 @@ package conf
 import (
 import (
 	"encoding/json"
 	"encoding/json"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/proxy/http"
 	"github.com/v2fly/v2ray-core/v4/proxy/http"
 )
 )
 
 

+ 1 - 3
infra/conf/router.go

@@ -5,13 +5,11 @@ import (
 	"encoding/json"
 	"encoding/json"
 	"strings"
 	"strings"
 
 
+	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
-
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 	rule2 "github.com/v2fly/v2ray-core/v4/infra/conf/rule"
 	rule2 "github.com/v2fly/v2ray-core/v4/infra/conf/rule"
-
-	"github.com/v2fly/v2ray-core/v4/app/router"
 )
 )
 
 
 type RouterRulesConfig struct {
 type RouterRulesConfig struct {

+ 1 - 2
infra/conf/rule/rule_test.go

@@ -13,9 +13,8 @@ import (
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/rule"
-
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/rule"
 )
 )
 
 
 func init() {
 func init() {

+ 1 - 2
infra/conf/shadowsocks.go

@@ -3,12 +3,11 @@ package conf
 import (
 import (
 	"strings"
 	"strings"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/proxy/shadowsocks"
 	"github.com/v2fly/v2ray-core/v4/proxy/shadowsocks"
 )
 )
 
 

+ 1 - 2
infra/conf/socks.go

@@ -3,12 +3,11 @@ package conf
 import (
 import (
 	"encoding/json"
 	"encoding/json"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/proxy/socks"
 	"github.com/v2fly/v2ray-core/v4/proxy/socks"
 )
 )
 
 

+ 1 - 2
infra/conf/transport_authenticators.go

@@ -3,10 +3,9 @@ package conf
 import (
 import (
 	"sort"
 	"sort"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/headers/http"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/headers/http"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/headers/noop"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/headers/noop"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/headers/srtp"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/headers/srtp"

+ 1 - 2
infra/conf/transport_internet.go

@@ -5,13 +5,12 @@ import (
 	"encoding/json"
 	"encoding/json"
 	"strings"
 	"strings"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/domainsocket"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/domainsocket"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/http"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/http"

+ 1 - 2
infra/conf/trojan.go

@@ -6,13 +6,12 @@ import (
 	"strconv"
 	"strconv"
 	"syscall"
 	"syscall"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/proxy/trojan"
 	"github.com/v2fly/v2ray-core/v4/proxy/trojan"
 )
 )
 
 

+ 1 - 2
infra/conf/v2ray.go

@@ -6,13 +6,12 @@ import (
 	"os"
 	"os"
 	"strings"
 	"strings"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/dispatcher"
 	"github.com/v2fly/v2ray-core/v4/app/dispatcher"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/stats"
 	"github.com/v2fly/v2ray-core/v4/app/stats"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 )
 )
 
 
 var (
 var (

+ 1 - 2
infra/conf/vless.go

@@ -6,13 +6,12 @@ import (
 	"strconv"
 	"strconv"
 	"syscall"
 	"syscall"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/proxy/vless"
 	"github.com/v2fly/v2ray-core/v4/proxy/vless"
 	"github.com/v2fly/v2ray-core/v4/proxy/vless/inbound"
 	"github.com/v2fly/v2ray-core/v4/proxy/vless/inbound"
 	"github.com/v2fly/v2ray-core/v4/proxy/vless/outbound"
 	"github.com/v2fly/v2ray-core/v4/proxy/vless/outbound"

+ 1 - 2
infra/conf/vmess.go

@@ -4,12 +4,11 @@ import (
 	"encoding/json"
 	"encoding/json"
 	"strings"
 	"strings"
 
 
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/proxy/vmess"
 	"github.com/v2fly/v2ray-core/v4/proxy/vmess"
 	"github.com/v2fly/v2ray-core/v4/proxy/vmess/inbound"
 	"github.com/v2fly/v2ray-core/v4/proxy/vmess/inbound"
 	"github.com/v2fly/v2ray-core/v4/proxy/vmess/outbound"
 	"github.com/v2fly/v2ray-core/v4/proxy/vmess/outbound"