1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00

code style

This commit is contained in:
loyalsoldier 2021-05-04 21:52:35 +08:00 committed by Shelikhoo
parent 40f8e82204
commit 2bdc86049a
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
19 changed files with 23 additions and 38 deletions

View File

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

View File

@ -6,15 +6,13 @@ import (
"sort" "sort"
"strings" "strings"
"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/geodata"
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/dns"
"github.com/v2fly/v2ray-core/v4/app/router" "github.com/v2fly/v2ray-core/v4/app/router"
"github.com/v2fly/v2ray-core/v4/common/net" "github.com/v2fly/v2ray-core/v4/common/net"
"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/geodata"
rule2 "github.com/v2fly/v2ray-core/v4/infra/conf/rule"
) )
type NameServerConfig struct { type NameServerConfig struct {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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