Browse Source

Reformat code

世界 4 years ago
parent
commit
a66bb28aee
100 changed files with 222 additions and 158 deletions
  1. 2 2
      app/commander/commander.go
  2. 3 3
      app/dns/dns.go
  3. 2 2
      app/dns/dns_test.go
  4. 3 1
      app/instman/command/command.go
  5. 2 1
      app/instman/instman.go
  6. 2 1
      app/log/command/command_test.go
  7. 3 1
      app/observatory/burst/burstobserver.go
  8. 2 1
      app/observatory/burst/healthping_result_test.go
  9. 1 1
      app/observatory/burst/ping.go
  10. 2 2
      app/observatory/command/command.go
  11. 2 0
      app/observatory/multiObservatory/muti.go
  12. 1 1
      app/proxyman/command/command.go
  13. 1 1
      app/proxyman/outbound/handler.go
  14. 2 1
      app/proxyman/outbound/handler_test.go
  15. 1 0
      app/restful-api/config.go
  16. 4 3
      app/restful-api/restful-api.go
  17. 3 2
      app/restful-api/service.go
  18. 2 1
      app/restful-api/service_test.go
  19. 2 1
      app/router/command/command.go
  20. 1 1
      app/router/command/command_test.go
  21. 1 1
      app/router/condition.go
  22. 1 1
      app/router/condition_geoip.go
  23. 1 1
      app/router/condition_geoip_test.go
  24. 1 1
      app/router/condition_test.go
  25. 2 0
      app/router/config.go
  26. 1 0
      app/router/router.go
  27. 1 1
      app/router/router_test.go
  28. 6 5
      app/router/strategy_leastload.go
  29. 1 1
      app/router/strategy_leastping.go
  30. 2 1
      common/net/address.go
  31. 1 1
      common/platform/filesystem/file.go
  32. 4 2
      common/protoext/testing/extension_test.go
  33. 6 4
      common/protofilter/filter.go
  34. 1 0
      common/registry/implementation_set.go
  35. 6 4
      common/registry/registry.go
  36. 1 1
      common/serial/typed_message.go
  37. 3 1
      common/taggedfeatures/configloader.go
  38. 1 0
      common/taggedfeatures/creator.go
  39. 4 3
      common/taggedfeatures/holder.go
  40. 1 0
      features/extension/instance.go
  41. 1 0
      features/extension/storage.go
  42. 1 1
      functions_test.go
  43. 1 0
      infra/conf/cfgcommon/buildable.go
  44. 1 0
      infra/conf/cfgcommon/session.go
  45. 2 1
      infra/conf/cfgcommon/sniffer/sniffer.go
  46. 2 1
      infra/conf/cfgcommon/socketcfg/socket.go
  47. 1 1
      infra/conf/cfgcommon/testassist/general.go
  48. 3 1
      infra/conf/cfgcommon/tlscfg/tls.go
  49. 2 1
      infra/conf/geodata/geodata.go
  50. 1 1
      infra/conf/geodata/memconservative/cache.go
  51. 1 1
      infra/conf/geodata/memconservative/memc.go
  52. 1 1
      infra/conf/geodata/standard/standard.go
  53. 3 1
      infra/conf/jsonpb/jsonpb.go
  54. 1 1
      infra/conf/rule/rule.go
  55. 1 1
      infra/conf/serial/loader.go
  56. 2 2
      infra/conf/synthetic/dns/dns.go
  57. 1 2
      infra/conf/synthetic/dns/dns_test.go
  58. 2 2
      infra/conf/synthetic/router/router_strategy.go
  59. 3 3
      infra/conf/synthetic/router/router_test.go
  60. 2 1
      infra/conf/v2jsonpb/follower.go
  61. 3 2
      infra/conf/v2jsonpb/v2jsonpb.go
  62. 1 1
      infra/conf/v4/api.go
  63. 2 2
      infra/conf/v4/blackhole.go
  64. 3 3
      infra/conf/v4/blackhole_test.go
  65. 3 3
      infra/conf/v4/dns_proxy_test.go
  66. 3 3
      infra/conf/v4/dokodemo_test.go
  67. 3 3
      infra/conf/v4/freedom_test.go
  68. 2 2
      infra/conf/v4/http_test.go
  69. 5 4
      infra/conf/v4/observatory.go
  70. 1 1
      infra/conf/v4/policy_test.go
  71. 3 3
      infra/conf/v4/reverse_test.go
  72. 1 1
      infra/conf/v4/services.go
  73. 3 3
      infra/conf/v4/shadowsocks_test.go
  74. 3 3
      infra/conf/v4/socks_test.go
  75. 3 3
      infra/conf/v4/transport_internet.go
  76. 3 3
      infra/conf/v4/transport_test.go
  77. 9 8
      infra/conf/v4/v2ray.go
  78. 9 9
      infra/conf/v4/v2ray_test.go
  79. 3 3
      infra/conf/v4/vless_test.go
  80. 3 3
      infra/conf/v4/vmess_test.go
  81. 2 0
      infra/conf/v5cfg/common.go
  82. 2 0
      infra/conf/v5cfg/inbound.go
  83. 2 1
      infra/conf/v5cfg/init.go
  84. 2 0
      infra/conf/v5cfg/outbound.go
  85. 3 1
      infra/conf/v5cfg/root.go
  86. 1 0
      infra/conf/v5cfg/skeleton.go
  87. 2 0
      infra/conf/v5cfg/stream.go
  88. 1 1
      main/commands/all/api/shared.go
  89. 5 3
      main/commands/all/engineering/convertpb.go
  90. 4 2
      main/commands/all/engineering/reversepb.go
  91. 2 2
      main/commands/all/jsonv4/convert.go
  92. 1 1
      main/commands/helpers/config_load.go
  93. 2 1
      main/v2binding/v2api/api.go
  94. 2 1
      main/v2binding/v2binding.go
  95. 1 1
      proxy/dns/dns_test.go
  96. 1 0
      proxy/socks/simplified/config.go
  97. 1 1
      proxy/vmess/inbound/inbound.go
  98. 1 1
      proxy/vmess/outbound/outbound.go
  99. 1 1
      testing/scenarios/command_test.go
  100. 2 2
      testing/scenarios/dns_test.go

+ 2 - 2
app/commander/commander.go

@@ -4,8 +4,6 @@ package commander
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/v2fly/v2ray-core/v4/common/serial"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v5cfg"
 	"net"
 	"net"
 	"sync"
 	"sync"
 
 
@@ -13,8 +11,10 @@ import (
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
+	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/signal/done"
 	"github.com/v2fly/v2ray-core/v4/common/signal/done"
 	"github.com/v2fly/v2ray-core/v4/features/outbound"
 	"github.com/v2fly/v2ray-core/v4/features/outbound"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v5cfg"
 )
 )
 
 
 // Commander is a V2Ray feature that provides gRPC methods to external clients.
 // Commander is a V2Ray feature that provides gRPC methods to external clients.

+ 3 - 3
app/dns/dns.go

@@ -9,9 +9,6 @@ package dns
 import (
 import (
 	"context"
 	"context"
 	"fmt"
 	"fmt"
-	"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"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
 
 
@@ -19,10 +16,13 @@ import (
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/errors"
 	"github.com/v2fly/v2ray-core/v4/common/errors"
 	"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/common/session"
 	"github.com/v2fly/v2ray-core/v4/common/session"
 	"github.com/v2fly/v2ray-core/v4/common/strmatcher"
 	"github.com/v2fly/v2ray-core/v4/common/strmatcher"
 	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features/dns"
 	"github.com/v2fly/v2ray-core/v4/features/dns"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 )
 )
 
 
 // DNS is a DNS rely server.
 // DNS is a DNS rely server.

+ 2 - 2
app/dns/dns_test.go

@@ -1,13 +1,12 @@
 package dns_test
 package dns_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
-	"google.golang.org/protobuf/types/known/anypb"
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
 	"github.com/google/go-cmp/cmp"
 	"github.com/google/go-cmp/cmp"
 	"github.com/miekg/dns"
 	"github.com/miekg/dns"
+	"google.golang.org/protobuf/types/known/anypb"
 
 
 	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"
@@ -15,6 +14,7 @@ import (
 	"github.com/v2fly/v2ray-core/v4/app/policy"
 	"github.com/v2fly/v2ray-core/v4/app/policy"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	_ "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
 	_ "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"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/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"

+ 3 - 1
app/instman/command/command.go

@@ -3,10 +3,12 @@ package command
 import (
 import (
 	"context"
 	"context"
 	"encoding/base64"
 	"encoding/base64"
+
+	"google.golang.org/grpc"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
-	"google.golang.org/grpc"
 )
 )
 
 
 type service struct {
 type service struct {

+ 2 - 1
app/instman/instman.go

@@ -2,6 +2,7 @@ package instman
 
 
 import (
 import (
 	"context"
 	"context"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
@@ -28,7 +29,7 @@ func (i InstanceMgr) Close() error {
 
 
 func (i InstanceMgr) ListInstance(ctx context.Context) ([]string, error) {
 func (i InstanceMgr) ListInstance(ctx context.Context) ([]string, error) {
 	var instanceNames []string
 	var instanceNames []string
-	for k, _ := range i.instances {
+	for k := range i.instances {
 		instanceNames = append(instanceNames, k)
 		instanceNames = append(instanceNames, k)
 	}
 	}
 	return instanceNames, nil
 	return instanceNames, nil

+ 2 - 1
app/log/command/command_test.go

@@ -2,9 +2,10 @@ package command_test
 
 
 import (
 import (
 	"context"
 	"context"
-	"google.golang.org/protobuf/types/known/anypb"
 	"testing"
 	"testing"
 
 
+	"google.golang.org/protobuf/types/known/anypb"
+
 	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/log"
 	"github.com/v2fly/v2ray-core/v4/app/log"

+ 3 - 1
app/observatory/burst/burstobserver.go

@@ -2,14 +2,16 @@ package burst
 
 
 import (
 import (
 	"context"
 	"context"
+	"sync"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/signal/done"
 	"github.com/v2fly/v2ray-core/v4/common/signal/done"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
 	"github.com/v2fly/v2ray-core/v4/features/outbound"
 	"github.com/v2fly/v2ray-core/v4/features/outbound"
-	"sync"
 )
 )
 
 
 type Observer struct {
 type Observer struct {

+ 2 - 1
app/observatory/burst/healthping_result_test.go

@@ -1,11 +1,12 @@
 package burst_test
 package burst_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
 	"math"
 	"math"
 	reflect "reflect"
 	reflect "reflect"
 	"testing"
 	"testing"
 	"time"
 	"time"
+
+	"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
 )
 )
 
 
 func TestHealthPingResults(t *testing.T) {
 func TestHealthPingResults(t *testing.T) {

+ 1 - 1
app/observatory/burst/ping.go

@@ -2,11 +2,11 @@ package burst
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/v2fly/v2ray-core/v4/transport/internet/tagged"
 	"net/http"
 	"net/http"
 	"time"
 	"time"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
+	"github.com/v2fly/v2ray-core/v4/transport/internet/tagged"
 )
 )
 
 
 type pingClient struct {
 type pingClient struct {

+ 2 - 2
app/observatory/command/command.go

@@ -7,14 +7,14 @@ package command
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/golang/protobuf/proto"
-	"github.com/v2fly/v2ray-core/v4/features"
 
 
+	"github.com/golang/protobuf/proto"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc"
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
+	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
 )
 )
 
 

+ 2 - 0
app/observatory/multiObservatory/muti.go

@@ -2,8 +2,10 @@ package multiObservatory
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/taggedfeatures"
 	"github.com/v2fly/v2ray-core/v4/common/taggedfeatures"
 	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features"

+ 1 - 1
app/proxyman/command/command.go

@@ -2,12 +2,12 @@ package command
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/v2fly/v2ray-core/v4/common/serial"
 
 
 	grpc "google.golang.org/grpc"
 	grpc "google.golang.org/grpc"
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
+	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/features/inbound"
 	"github.com/v2fly/v2ray-core/v4/features/inbound"
 	"github.com/v2fly/v2ray-core/v4/features/outbound"
 	"github.com/v2fly/v2ray-core/v4/features/outbound"
 	"github.com/v2fly/v2ray-core/v4/proxy"
 	"github.com/v2fly/v2ray-core/v4/proxy"

+ 1 - 1
app/proxyman/outbound/handler.go

@@ -2,13 +2,13 @@ package outbound
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/v2fly/v2ray-core/v4/common/serial"
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/mux"
 	"github.com/v2fly/v2ray-core/v4/common/mux"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
+	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/session"
 	"github.com/v2fly/v2ray-core/v4/common/session"
 	"github.com/v2fly/v2ray-core/v4/features/outbound"
 	"github.com/v2fly/v2ray-core/v4/features/outbound"
 	"github.com/v2fly/v2ray-core/v4/features/policy"
 	"github.com/v2fly/v2ray-core/v4/features/policy"

+ 2 - 1
app/proxyman/outbound/handler_test.go

@@ -2,10 +2,11 @@ package outbound_test
 
 
 import (
 import (
 	"context"
 	"context"
-	"google.golang.org/protobuf/types/known/anypb"
 	"testing"
 	"testing"
 	_ "unsafe"
 	_ "unsafe"
 
 
+	"google.golang.org/protobuf/types/known/anypb"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/policy"
 	"github.com/v2fly/v2ray-core/v4/app/policy"
 	. "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
 	. "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"

+ 1 - 0
app/restful-api/config.go

@@ -2,6 +2,7 @@ package restful_api
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 )
 )
 
 

+ 4 - 3
app/restful-api/restful-api.go

@@ -1,16 +1,17 @@
 package restful_api
 package restful_api
 
 
 import (
 import (
+	"net/http"
+	"strings"
+
 	"github.com/go-chi/chi/v5"
 	"github.com/go-chi/chi/v5"
 	"github.com/go-chi/chi/v5/middleware"
 	"github.com/go-chi/chi/v5/middleware"
 	"github.com/go-chi/render"
 	"github.com/go-chi/render"
 	"github.com/go-playground/validator/v10"
 	"github.com/go-playground/validator/v10"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
-
-	"net/http"
-	"strings"
 )
 )
 
 
 var validate *validator.Validate
 var validate *validator.Validate

+ 3 - 2
app/restful-api/service.go

@@ -2,11 +2,12 @@ package restful_api
 
 
 import (
 import (
 	"context"
 	"context"
+	"net"
+	"sync"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features"
 	feature_stats "github.com/v2fly/v2ray-core/v4/features/stats"
 	feature_stats "github.com/v2fly/v2ray-core/v4/features/stats"
-	"net"
-	"sync"
 )
 )
 
 
 //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

+ 2 - 1
app/restful-api/service_test.go

@@ -1,9 +1,10 @@
 package restful_api
 package restful_api
 
 
 import (
 import (
-	"github.com/stretchr/testify/assert"
 	"reflect"
 	"reflect"
 	"testing"
 	"testing"
+
+	"github.com/stretchr/testify/assert"
 )
 )
 
 
 func TestTypeReturnAnonymousType(t *testing.T) {
 func TestTypeReturnAnonymousType(t *testing.T) {

+ 2 - 1
app/router/command/command.go

@@ -6,11 +6,12 @@ import (
 	"context"
 	"context"
 	"time"
 	"time"
 
 
+	"google.golang.org/grpc"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/features/routing"
 	"github.com/v2fly/v2ray-core/v4/features/routing"
 	"github.com/v2fly/v2ray-core/v4/features/stats"
 	"github.com/v2fly/v2ray-core/v4/features/stats"
-	"google.golang.org/grpc"
 )
 )
 
 
 // routingServer is an implementation of RoutingService.
 // routingServer is an implementation of RoutingService.

+ 1 - 1
app/router/command/command_test.go

@@ -2,7 +2,6 @@ package command_test
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
@@ -14,6 +13,7 @@ import (
 
 
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	. "github.com/v2fly/v2ray-core/v4/app/router/command"
 	. "github.com/v2fly/v2ray-core/v4/app/router/command"
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"github.com/v2fly/v2ray-core/v4/app/stats"
 	"github.com/v2fly/v2ray-core/v4/app/stats"
 	"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"

+ 1 - 1
app/router/condition.go

@@ -1,12 +1,12 @@
 package router
 package router
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"strings"
 	"strings"
 
 
 	"go.starlark.net/starlark"
 	"go.starlark.net/starlark"
 	"go.starlark.net/syntax"
 	"go.starlark.net/syntax"
 
 
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/strmatcher"
 	"github.com/v2fly/v2ray-core/v4/common/strmatcher"
 	"github.com/v2fly/v2ray-core/v4/features/routing"
 	"github.com/v2fly/v2ray-core/v4/features/routing"

+ 1 - 1
app/router/condition_geoip.go

@@ -1,9 +1,9 @@
 package router
 package router
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"inet.af/netaddr"
 	"inet.af/netaddr"
 
 
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 )
 )
 
 

+ 1 - 1
app/router/condition_geoip_test.go

@@ -2,7 +2,6 @@ package router_test
 
 
 import (
 import (
 	"errors"
 	"errors"
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"io/fs"
 	"io/fs"
 	"os"
 	"os"
 	"path/filepath"
 	"path/filepath"
@@ -12,6 +11,7 @@ import (
 	"google.golang.org/protobuf/proto"
 	"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/app/router/routercommon"
 	"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/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"

+ 1 - 1
app/router/condition_test.go

@@ -2,7 +2,6 @@ package router_test
 
 
 import (
 import (
 	"errors"
 	"errors"
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"io/fs"
 	"io/fs"
 	"os"
 	"os"
 	"path/filepath"
 	"path/filepath"
@@ -13,6 +12,7 @@ import (
 	"google.golang.org/protobuf/proto"
 	"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/app/router/routercommon"
 	"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/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"

+ 2 - 0
app/router/config.go

@@ -6,7 +6,9 @@ package router
 import (
 import (
 	"context"
 	"context"
 	"encoding/json"
 	"encoding/json"
+
 	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/jsonpb"
+
 	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"

+ 1 - 0
app/router/router.go

@@ -4,6 +4,7 @@ package router
 
 
 import (
 import (
 	"context"
 	"context"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"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"

+ 1 - 1
app/router/router_test.go

@@ -2,12 +2,12 @@ package router_test
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"testing"
 	"testing"
 
 
 	"github.com/golang/mock/gomock"
 	"github.com/golang/mock/gomock"
 
 
 	. "github.com/v2fly/v2ray-core/v4/app/router"
 	. "github.com/v2fly/v2ray-core/v4/app/router"
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"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/session"
 	"github.com/v2fly/v2ray-core/v4/common/session"

+ 6 - 5
app/router/strategy_leastload.go

@@ -2,17 +2,18 @@ package router
 
 
 import (
 import (
 	"context"
 	"context"
+	"math"
+	"sort"
+	"time"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
+	"github.com/v2fly/v2ray-core/v4/common/dice"
 	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
-	"math"
-	"sort"
-	"time"
-
-	"github.com/v2fly/v2ray-core/v4/common/dice"
 )
 )
 
 
 // LeastLoadStrategy represents a least load balancing strategy
 // LeastLoadStrategy represents a least load balancing strategy

+ 1 - 1
app/router/strategy_leastping.go

@@ -5,11 +5,11 @@ package router
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/v2fly/v2ray-core/v4/features"
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
+	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
 	"github.com/v2fly/v2ray-core/v4/features/extension"
 )
 )
 
 

+ 2 - 1
common/net/address.go

@@ -3,9 +3,10 @@ package net
 import (
 import (
 	"bytes"
 	"bytes"
 	"encoding/json"
 	"encoding/json"
-	"github.com/golang/protobuf/jsonpb"
 	"net"
 	"net"
 	"strings"
 	"strings"
+
+	"github.com/golang/protobuf/jsonpb"
 )
 )
 
 
 var (
 var (

+ 1 - 1
common/platform/filesystem/file.go

@@ -1,12 +1,12 @@
 package filesystem
 package filesystem
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem/fsifce"
 	"io"
 	"io"
 	"os"
 	"os"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/buf"
 	"github.com/v2fly/v2ray-core/v4/common/buf"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
+	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem/fsifce"
 )
 )
 
 
 var NewFileSeeker fsifce.FileSeekerFunc = func(path string) (io.ReadSeekCloser, error) {
 var NewFileSeeker fsifce.FileSeekerFunc = func(path string) (io.ReadSeekCloser, error) {

+ 4 - 2
common/protoext/testing/extension_test.go

@@ -1,10 +1,12 @@
 package testing
 package testing
 
 
 import (
 import (
+	"testing"
+
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/assert"
-	"github.com/v2fly/v2ray-core/v4/common/protoext"
 	"google.golang.org/protobuf/reflect/protoreflect"
 	"google.golang.org/protobuf/reflect/protoreflect"
-	"testing"
+
+	"github.com/v2fly/v2ray-core/v4/common/protoext"
 )
 )
 
 
 func TestMessageOpt(t *testing.T) {
 func TestMessageOpt(t *testing.T) {

+ 6 - 4
common/protofilter/filter.go

@@ -2,13 +2,15 @@ package protofilter
 
 
 import (
 import (
 	"context"
 	"context"
+	"io"
+	"net"
+
+	"google.golang.org/protobuf/proto"
+	"google.golang.org/protobuf/reflect/protoreflect"
+
 	"github.com/v2fly/v2ray-core/v4/common/environment/envctx"
 	"github.com/v2fly/v2ray-core/v4/common/environment/envctx"
 	"github.com/v2fly/v2ray-core/v4/common/environment/filesystemcap"
 	"github.com/v2fly/v2ray-core/v4/common/environment/filesystemcap"
 	"github.com/v2fly/v2ray-core/v4/common/protoext"
 	"github.com/v2fly/v2ray-core/v4/common/protoext"
-	"google.golang.org/protobuf/proto"
-	"google.golang.org/protobuf/reflect/protoreflect"
-	"io"
-	"net"
 )
 )
 
 
 //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 - 0
common/registry/implementation_set.go

@@ -2,6 +2,7 @@ package registry
 
 
 import (
 import (
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	"github.com/v2fly/v2ray-core/v4/common/protoext"
 	"github.com/v2fly/v2ray-core/v4/common/protoext"
 )
 )
 
 

+ 6 - 4
common/registry/registry.go

@@ -3,15 +3,17 @@ package registry
 import (
 import (
 	"bytes"
 	"bytes"
 	"context"
 	"context"
+	"reflect"
+	"strings"
+	"sync"
+
 	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+	protov2 "google.golang.org/protobuf/proto"
+
 	"github.com/v2fly/v2ray-core/v4/common/protoext"
 	"github.com/v2fly/v2ray-core/v4/common/protoext"
 	"github.com/v2fly/v2ray-core/v4/common/protofilter"
 	"github.com/v2fly/v2ray-core/v4/common/protofilter"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
-	protov2 "google.golang.org/protobuf/proto"
-	"reflect"
-	"strings"
-	"sync"
 )
 )
 
 
 type implementationRegistry struct {
 type implementationRegistry struct {

+ 1 - 1
common/serial/typed_message.go

@@ -2,11 +2,11 @@ package serial
 
 
 import (
 import (
 	"errors"
 	"errors"
-	"google.golang.org/protobuf/types/known/anypb"
 	"reflect"
 	"reflect"
 	"strings"
 	"strings"
 
 
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+	"google.golang.org/protobuf/types/known/anypb"
 )
 )
 
 
 const V2RayTypeURLHeader = "types.v2fly.org/"
 const V2RayTypeURLHeader = "types.v2fly.org/"

+ 3 - 1
common/taggedfeatures/configloader.go

@@ -3,9 +3,11 @@ package taggedfeatures
 import (
 import (
 	"context"
 	"context"
 	"encoding/json"
 	"encoding/json"
+
+	"google.golang.org/protobuf/types/known/anypb"
+
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/v5cfg"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/v5cfg"
-	"google.golang.org/protobuf/types/known/anypb"
 )
 )
 
 
 func LoadJsonConfig(ctx context.Context, interfaceType, defaultImpl string, message json.RawMessage) (*Config, error) {
 func LoadJsonConfig(ctx context.Context, interfaceType, defaultImpl string, message json.RawMessage) (*Config, error) {

+ 1 - 0
common/taggedfeatures/creator.go

@@ -2,6 +2,7 @@ package taggedfeatures
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features"

+ 4 - 3
common/taggedfeatures/holder.go

@@ -2,10 +2,11 @@ package taggedfeatures
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/v2fly/v2ray-core/v4/common/task"
-	"github.com/v2fly/v2ray-core/v4/features"
 	"reflect"
 	"reflect"
 	"sync"
 	"sync"
+
+	"github.com/v2fly/v2ray-core/v4/common/task"
+	"github.com/v2fly/v2ray-core/v4/features"
 )
 )
 
 
 type Holder struct {
 type Holder struct {
@@ -56,7 +57,7 @@ func (h *Holder) GetFeaturesTag() ([]string, error) {
 	h.access.RLock()
 	h.access.RLock()
 	defer h.access.RUnlock()
 	defer h.access.RUnlock()
 	var ret []string
 	var ret []string
-	for key, _ := range h.features {
+	for key := range h.features {
 		ret = append(ret, key)
 		ret = append(ret, key)
 	}
 	}
 	return ret, nil
 	return ret, nil

+ 1 - 0
features/extension/instance.go

@@ -2,6 +2,7 @@ package extension
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features"
 )
 )
 
 

+ 1 - 0
features/extension/storage.go

@@ -2,6 +2,7 @@ package extension
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/v2fly/v2ray-core/v4/features"
 	"github.com/v2fly/v2ray-core/v4/features"
 )
 )
 
 

+ 1 - 1
functions_test.go

@@ -3,13 +3,13 @@ package core_test
 import (
 import (
 	"context"
 	"context"
 	"crypto/rand"
 	"crypto/rand"
-	"google.golang.org/protobuf/types/known/anypb"
 	"io"
 	"io"
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
 	"github.com/google/go-cmp/cmp"
 	"github.com/google/go-cmp/cmp"
 	"google.golang.org/protobuf/proto"
 	"google.golang.org/protobuf/proto"
+	"google.golang.org/protobuf/types/known/anypb"
 
 
 	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"

+ 1 - 0
infra/conf/cfgcommon/buildable.go

@@ -2,6 +2,7 @@ package cfgcommon
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 )
 )
 
 

+ 1 - 0
infra/conf/cfgcommon/session.go

@@ -2,6 +2,7 @@ package cfgcommon
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 )
 )

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

@@ -1,9 +1,10 @@
 package sniffer
 package sniffer
 
 
 import (
 import (
+	"strings"
+
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"strings"
 )
 )
 
 
 //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

+ 2 - 1
infra/conf/cfgcommon/socketcfg/socket.go

@@ -1,8 +1,9 @@
 package socketcfg
 package socketcfg
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/transport/internet"
 	"strings"
 	"strings"
+
+	"github.com/v2fly/v2ray-core/v4/transport/internet"
 )
 )
 
 
 type SocketConfig struct {
 type SocketConfig struct {

+ 1 - 1
infra/conf/cfgcommon/testassist/general.go

@@ -2,12 +2,12 @@ package testassist
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"testing"
 	"testing"
 
 
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 )
 )
 
 
 func LoadJSON(creator func() cfgcommon.Buildable) func(string) (proto.Message, error) {
 func LoadJSON(creator func() cfgcommon.Buildable) func(string) (proto.Message, error) {

+ 3 - 1
infra/conf/cfgcommon/tlscfg/tls.go

@@ -2,11 +2,13 @@ package tlscfg
 
 
 import (
 import (
 	"encoding/base64"
 	"encoding/base64"
+	"strings"
+
 	"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/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/tls"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/tls"
-	"strings"
 )
 )
 
 
 //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

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

@@ -1,8 +1,9 @@
 package geodata
 package geodata
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"strings"
 	"strings"
+
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 )
 )
 
 
 type loader struct {
 type loader struct {

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

@@ -1,12 +1,12 @@
 package memconservative
 package memconservative
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"io/ioutil"
 	"io/ioutil"
 	"strings"
 	"strings"
 
 
 	"google.golang.org/protobuf/proto"
 	"google.golang.org/protobuf/proto"
 
 
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 )
 )
 
 

+ 1 - 1
infra/conf/geodata/memconservative/memc.go

@@ -1,9 +1,9 @@
 package memconservative
 package memconservative
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"runtime"
 	"runtime"
 
 
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 )
 )
 
 

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

@@ -1,11 +1,11 @@
 package standard
 package standard
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"strings"
 	"strings"
 
 
 	"google.golang.org/protobuf/proto"
 	"google.golang.org/protobuf/proto"
 
 
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"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"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
 )
 )

+ 3 - 1
infra/conf/jsonpb/jsonpb.go

@@ -2,14 +2,16 @@ package jsonpb
 
 
 import (
 import (
 	"bytes"
 	"bytes"
+	"io"
+
 	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/buf"
 	"github.com/v2fly/v2ray-core/v4/common/buf"
 	"github.com/v2fly/v2ray-core/v4/common/cmdarg"
 	"github.com/v2fly/v2ray-core/v4/common/cmdarg"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
-	"io"
 )
 )
 
 
 //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 - 1
infra/conf/rule/rule.go

@@ -3,11 +3,11 @@ package rule
 import (
 import (
 	"context"
 	"context"
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
 
 
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/app/router"
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"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/infra/conf/cfgcommon"
 )
 )

+ 1 - 1
infra/conf/serial/loader.go

@@ -3,12 +3,12 @@ package serial
 import (
 import (
 	"bytes"
 	"bytes"
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"io"
 	"io"
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common/errors"
 	"github.com/v2fly/v2ray-core/v4/common/errors"
 	json_reader "github.com/v2fly/v2ray-core/v4/infra/conf/json"
 	json_reader "github.com/v2fly/v2ray-core/v4/infra/conf/json"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 )
 )
 
 
 type offset struct {
 type offset struct {

+ 2 - 2
infra/conf/synthetic/dns/dns.go

@@ -5,11 +5,11 @@ package dns
 import (
 import (
 	"context"
 	"context"
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"sort"
 	"sort"
 	"strings"
 	"strings"
 
 
 	"github.com/v2fly/v2ray-core/v4/app/dns"
 	"github.com/v2fly/v2ray-core/v4/app/dns"
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"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/common/platform"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
@@ -148,7 +148,7 @@ type DNSConfig struct {
 	DisableCache           bool                    `json:"disableCache"`
 	DisableCache           bool                    `json:"disableCache"`
 	DisableFallback        bool                    `json:"disableFallback"`
 	DisableFallback        bool                    `json:"disableFallback"`
 	DisableFallbackIfMatch bool                    `json:"disableFallbackIfMatch"`
 	DisableFallbackIfMatch bool                    `json:"disableFallbackIfMatch"`
-	cfgctx context.Context
+	cfgctx                 context.Context
 }
 }
 
 
 type HostAddress struct {
 type HostAddress struct {

+ 1 - 2
infra/conf/synthetic/dns/dns_test.go

@@ -3,7 +3,6 @@ package dns_test
 import (
 import (
 	"encoding/json"
 	"encoding/json"
 	"errors"
 	"errors"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
 	"io/fs"
 	"io/fs"
 	"os"
 	"os"
 	"path/filepath"
 	"path/filepath"
@@ -15,8 +14,8 @@ import (
 	"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/platform/filesystem"
 	"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
-
 	dns2 "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/dns"
 	dns2 "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/dns"
 )
 )
 
 

+ 2 - 2
infra/conf/synthetic/router/router_strategy.go

@@ -2,11 +2,11 @@ package router
 
 
 import (
 import (
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
 	"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
+	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/duration"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/duration"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
-
-	"github.com/v2fly/v2ray-core/v4/app/router"
 )
 )
 
 
 const (
 const (

+ 3 - 3
infra/conf/synthetic/router/router_test.go

@@ -2,9 +2,6 @@ package router_test
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	router2 "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
 	"testing"
 	"testing"
 	"time"
 	"time"
 	_ "unsafe"
 	_ "unsafe"
@@ -12,12 +9,15 @@ import (
 	"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/app/router/routercommon"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"github.com/v2fly/v2ray-core/v4/common/net"
 	"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/testassist"
 
 
 	// Geo loaders
 	// Geo loaders
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/memconservative"
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/memconservative"
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
 	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
+	router2 "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
 )
 )
 
 
 func TestRouterConfig(t *testing.T) {
 func TestRouterConfig(t *testing.T) {

+ 2 - 1
infra/conf/v2jsonpb/follower.go

@@ -1,10 +1,11 @@
 package v2jsonpb
 package v2jsonpb
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"google.golang.org/protobuf/proto"
 	"google.golang.org/protobuf/proto"
 	"google.golang.org/protobuf/reflect/protoreflect"
 	"google.golang.org/protobuf/reflect/protoreflect"
 	"google.golang.org/protobuf/types/known/anypb"
 	"google.golang.org/protobuf/types/known/anypb"
+
+	"github.com/v2fly/v2ray-core/v4/common/serial"
 )
 )
 
 
 type V2JsonProtobufFollowerFieldDescriptor struct {
 type V2JsonProtobufFollowerFieldDescriptor struct {

+ 3 - 2
infra/conf/v2jsonpb/v2jsonpb.go

@@ -1,7 +1,8 @@
 package v2jsonpb
 package v2jsonpb
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/common/serial"
+	"io"
+
 	"google.golang.org/protobuf/encoding/protojson"
 	"google.golang.org/protobuf/encoding/protojson"
 	"google.golang.org/protobuf/proto"
 	"google.golang.org/protobuf/proto"
 
 
@@ -9,7 +10,7 @@ import (
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/buf"
 	"github.com/v2fly/v2ray-core/v4/common/buf"
 	"github.com/v2fly/v2ray-core/v4/common/cmdarg"
 	"github.com/v2fly/v2ray-core/v4/common/cmdarg"
-	"io"
+	"github.com/v2fly/v2ray-core/v4/common/serial"
 )
 )
 
 
 //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 - 1
infra/conf/v4/api.go

@@ -1,11 +1,11 @@
 package v4
 package v4
 
 
 import (
 import (
-	"google.golang.org/protobuf/types/known/anypb"
 	"strings"
 	"strings"
 
 
 	"github.com/jhump/protoreflect/desc"
 	"github.com/jhump/protoreflect/desc"
 	"github.com/jhump/protoreflect/dynamic"
 	"github.com/jhump/protoreflect/dynamic"
+	"google.golang.org/protobuf/types/known/anypb"
 
 
 	"github.com/v2fly/v2ray-core/v4/app/commander"
 	"github.com/v2fly/v2ray-core/v4/app/commander"
 	loggerservice "github.com/v2fly/v2ray-core/v4/app/log/command"
 	loggerservice "github.com/v2fly/v2ray-core/v4/app/log/command"

+ 2 - 2
infra/conf/v4/blackhole.go

@@ -2,12 +2,12 @@ package v4
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
 
 
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
 
 
 	"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/infra/conf/cfgcommon/loader"
 	"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
 	"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
 )
 )
 
 

+ 3 - 3
infra/conf/v4/blackhole_test.go

@@ -1,12 +1,12 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"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/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
 	"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
 )
 )
 
 

+ 3 - 3
infra/conf/v4/dns_proxy_test.go

@@ -1,12 +1,12 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"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/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"github.com/v2fly/v2ray-core/v4/proxy/dns"
 	"github.com/v2fly/v2ray-core/v4/proxy/dns"
 )
 )
 
 

+ 3 - 3
infra/conf/v4/dokodemo_test.go

@@ -1,12 +1,12 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"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/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"github.com/v2fly/v2ray-core/v4/proxy/dokodemo"
 	"github.com/v2fly/v2ray-core/v4/proxy/dokodemo"
 )
 )
 
 

+ 3 - 3
infra/conf/v4/freedom_test.go

@@ -1,13 +1,13 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"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"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"github.com/v2fly/v2ray-core/v4/proxy/freedom"
 	"github.com/v2fly/v2ray-core/v4/proxy/freedom"
 )
 )
 
 

+ 2 - 2
infra/conf/v4/http_test.go

@@ -1,11 +1,11 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
+	"testing"
+
 	"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/cfgcommon/testassist"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
-	"testing"
-
 	"github.com/v2fly/v2ray-core/v4/proxy/http"
 	"github.com/v2fly/v2ray-core/v4/proxy/http"
 )
 )
 
 

+ 5 - 4
infra/conf/v4/observatory.go

@@ -2,16 +2,17 @@ package v4
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+	"google.golang.org/protobuf/types/known/anypb"
+
+	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
 	"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
 	"github.com/v2fly/v2ray-core/v4/app/observatory/multiObservatory"
 	"github.com/v2fly/v2ray-core/v4/app/observatory/multiObservatory"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/taggedfeatures"
 	"github.com/v2fly/v2ray-core/v4/common/taggedfeatures"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
-	"google.golang.org/protobuf/types/known/anypb"
-
-	"github.com/v2fly/v2ray-core/v4/app/observatory"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/duration"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/duration"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
 )
 )
 
 
 type ObservatoryConfig struct {
 type ObservatoryConfig struct {

+ 1 - 1
infra/conf/v4/policy_test.go

@@ -1,10 +1,10 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 )
 )
 
 
 func TestBufferSize(t *testing.T) {
 func TestBufferSize(t *testing.T) {

+ 3 - 3
infra/conf/v4/reverse_test.go

@@ -1,12 +1,12 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"github.com/v2fly/v2ray-core/v4/app/reverse"
 	"github.com/v2fly/v2ray-core/v4/app/reverse"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 )
 )
 
 
 func TestReverseConfig(t *testing.T) {
 func TestReverseConfig(t *testing.T) {

+ 1 - 1
infra/conf/v4/services.go

@@ -2,11 +2,11 @@ package v4
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"google.golang.org/protobuf/types/known/anypb"
 
 
 	"github.com/golang/protobuf/jsonpb"
 	"github.com/golang/protobuf/jsonpb"
 	"github.com/jhump/protoreflect/desc"
 	"github.com/jhump/protoreflect/desc"
 	"github.com/jhump/protoreflect/dynamic"
 	"github.com/jhump/protoreflect/dynamic"
+	"google.golang.org/protobuf/types/known/anypb"
 
 
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 )
 )

+ 3 - 3
infra/conf/v4/shadowsocks_test.go

@@ -1,14 +1,14 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"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/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"github.com/v2fly/v2ray-core/v4/proxy/shadowsocks"
 	"github.com/v2fly/v2ray-core/v4/proxy/shadowsocks"
 )
 )
 
 

+ 3 - 3
infra/conf/v4/socks_test.go

@@ -1,14 +1,14 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"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/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"github.com/v2fly/v2ray-core/v4/proxy/socks"
 	"github.com/v2fly/v2ray-core/v4/proxy/socks"
 )
 )
 
 

+ 3 - 3
infra/conf/v4/transport_internet.go

@@ -2,9 +2,6 @@ package v4
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/socketcfg"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/tlscfg"
 	"strings"
 	"strings"
 
 
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
@@ -12,6 +9,9 @@ import (
 	"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/infra/conf/cfgcommon"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/socketcfg"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/tlscfg"
 	"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"
 	httpheader "github.com/v2fly/v2ray-core/v4/transport/internet/headers/http"
 	httpheader "github.com/v2fly/v2ray-core/v4/transport/internet/headers/http"

+ 3 - 3
infra/conf/v4/transport_test.go

@@ -2,15 +2,15 @@ package v4_test
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/socketcfg"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"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/socketcfg"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"github.com/v2fly/v2ray-core/v4/transport"
 	"github.com/v2fly/v2ray-core/v4/transport"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/headers/http"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/headers/http"

+ 9 - 8
infra/conf/v4/v2ray.go

@@ -2,22 +2,23 @@ package v4
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/proxycfg"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/sniffer"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/dns"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/log"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
-	"google.golang.org/protobuf/types/known/anypb"
 	"strings"
 	"strings"
 
 
+	"google.golang.org/protobuf/types/known/anypb"
+
 	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"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/proxycfg"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/sniffer"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/dns"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/log"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
 )
 )
 
 
 var (
 var (

+ 9 - 9
infra/conf/v4/v2ray_test.go

@@ -2,26 +2,30 @@ package v4_test
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
-	"google.golang.org/protobuf/types/known/anypb"
 	"reflect"
 	"reflect"
 	"testing"
 	"testing"
 
 
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+	"google.golang.org/protobuf/types/known/anypb"
 
 
 	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/log"
 	"github.com/v2fly/v2ray-core/v4/app/log"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/app/router"
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	clog "github.com/v2fly/v2ray-core/v4/common/log"
 	clog "github.com/v2fly/v2ray-core/v4/common/log"
 	"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/muxcfg"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
+
+	// Geo loaders
+	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/memconservative"
+	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
 	"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
 	dns_proxy "github.com/v2fly/v2ray-core/v4/proxy/dns"
 	dns_proxy "github.com/v2fly/v2ray-core/v4/proxy/dns"
 	"github.com/v2fly/v2ray-core/v4/proxy/freedom"
 	"github.com/v2fly/v2ray-core/v4/proxy/freedom"
@@ -31,10 +35,6 @@ import (
 	"github.com/v2fly/v2ray-core/v4/transport/internet/http"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/http"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/tls"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/tls"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/websocket"
 	"github.com/v2fly/v2ray-core/v4/transport/internet/websocket"
-
-	// Geo loaders
-	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/memconservative"
-	_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
 )
 )
 
 
 func TestV2RayConfig(t *testing.T) {
 func TestV2RayConfig(t *testing.T) {

+ 3 - 3
infra/conf/v4/vless_test.go

@@ -1,14 +1,14 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"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/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"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"

+ 3 - 3
infra/conf/v4/vmess_test.go

@@ -1,14 +1,14 @@
 package v4_test
 package v4_test
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"testing"
 	"testing"
 
 
 	"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/infra/conf/cfgcommon/testassist"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"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"

+ 2 - 0
infra/conf/v5cfg/common.go

@@ -3,7 +3,9 @@ package v5cfg
 import (
 import (
 	"context"
 	"context"
 	"encoding/json"
 	"encoding/json"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	"github.com/v2fly/v2ray-core/v4/common/environment/envctx"
 	"github.com/v2fly/v2ray-core/v4/common/environment/envctx"
 	"github.com/v2fly/v2ray-core/v4/common/environment/envimpl"
 	"github.com/v2fly/v2ray-core/v4/common/environment/envimpl"
 	"github.com/v2fly/v2ray-core/v4/common/registry"
 	"github.com/v2fly/v2ray-core/v4/common/registry"

+ 2 - 0
infra/conf/v5cfg/inbound.go

@@ -2,7 +2,9 @@ package v5cfg
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"

+ 2 - 1
infra/conf/v5cfg/init.go

@@ -1,11 +1,12 @@
 package v5cfg
 package v5cfg
 
 
 import (
 import (
+	"io"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/buf"
 	"github.com/v2fly/v2ray-core/v4/common/buf"
 	"github.com/v2fly/v2ray-core/v4/common/cmdarg"
 	"github.com/v2fly/v2ray-core/v4/common/cmdarg"
-	"io"
 )
 )
 
 
 const jsonV5 = "jsonv5"
 const jsonV5 = "jsonv5"

+ 2 - 0
infra/conf/v5cfg/outbound.go

@@ -2,7 +2,9 @@ package v5cfg
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"

+ 3 - 1
infra/conf/v5cfg/root.go

@@ -3,7 +3,10 @@ package v5cfg
 import (
 import (
 	"context"
 	"context"
 	"encoding/json"
 	"encoding/json"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+	"google.golang.org/protobuf/types/known/anypb"
+
 	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"
@@ -12,7 +15,6 @@ import (
 	"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/synthetic/log"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/log"
-	"google.golang.org/protobuf/types/known/anypb"
 )
 )
 
 
 func (c RootConfig) BuildV5(ctx context.Context) (proto.Message, error) {
 func (c RootConfig) BuildV5(ctx context.Context) (proto.Message, error) {

+ 1 - 0
infra/conf/v5cfg/skeleton.go

@@ -2,6 +2,7 @@ package v5cfg
 
 
 import (
 import (
 	"encoding/json"
 	"encoding/json"
+
 	"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/cfgcommon/muxcfg"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/proxycfg"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/proxycfg"

+ 2 - 0
infra/conf/v5cfg/stream.go

@@ -2,7 +2,9 @@ package v5cfg
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
 	"github.com/v2fly/v2ray-core/v4/transport/internet"
 )
 )

+ 1 - 1
main/commands/all/api/shared.go

@@ -3,12 +3,12 @@ package api
 import (
 import (
 	"context"
 	"context"
 	"fmt"
 	"fmt"
-	"google.golang.org/protobuf/encoding/protojson"
 	"os"
 	"os"
 	"strings"
 	"strings"
 	"time"
 	"time"
 
 
 	"google.golang.org/grpc"
 	"google.golang.org/grpc"
+	"google.golang.org/protobuf/encoding/protojson"
 	"google.golang.org/protobuf/proto"
 	"google.golang.org/protobuf/proto"
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"

+ 5 - 3
main/commands/all/engineering/convertpb.go

@@ -3,12 +3,14 @@ package engineering
 import (
 import (
 	"bytes"
 	"bytes"
 	"fmt"
 	"fmt"
+	"io"
+	"os"
+
+	"google.golang.org/protobuf/proto"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/common/cmdarg"
 	"github.com/v2fly/v2ray-core/v4/common/cmdarg"
 	"github.com/v2fly/v2ray-core/v4/main/commands/base"
 	"github.com/v2fly/v2ray-core/v4/main/commands/base"
-	"google.golang.org/protobuf/proto"
-	"io"
-	"os"
 )
 )
 
 
 var (
 var (

+ 4 - 2
main/commands/all/engineering/reversepb.go

@@ -3,13 +3,15 @@ package engineering
 import (
 import (
 	"bytes"
 	"bytes"
 	"flag"
 	"flag"
+	"io"
+	"os"
+
 	"github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/proto"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/jsonpb"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/jsonpb"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/v2jsonpb"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/v2jsonpb"
 	"github.com/v2fly/v2ray-core/v4/main/commands/base"
 	"github.com/v2fly/v2ray-core/v4/main/commands/base"
-	"io"
-	"os"
 )
 )
 
 
 var cmdReversePb = &base.Command{
 var cmdReversePb = &base.Command{

+ 2 - 2
main/commands/all/jsonv4/convert.go

@@ -3,8 +3,6 @@ package jsonv4
 import (
 import (
 	"bytes"
 	"bytes"
 	"encoding/json"
 	"encoding/json"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/jsonpb"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v2jsonpb"
 	"os"
 	"os"
 	"strings"
 	"strings"
 
 
@@ -13,7 +11,9 @@ import (
 	"gopkg.in/yaml.v2"
 	"gopkg.in/yaml.v2"
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/jsonpb"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/merge"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/merge"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v2jsonpb"
 	"github.com/v2fly/v2ray-core/v4/main/commands/base"
 	"github.com/v2fly/v2ray-core/v4/main/commands/base"
 	"github.com/v2fly/v2ray-core/v4/main/commands/helpers"
 	"github.com/v2fly/v2ray-core/v4/main/commands/helpers"
 )
 )

+ 1 - 1
main/commands/helpers/config_load.go

@@ -2,12 +2,12 @@ package helpers
 
 
 import (
 import (
 	"bytes"
 	"bytes"
-	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 	"os"
 	"os"
 
 
 	"github.com/v2fly/v2ray-core/v4/infra/conf/merge"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/merge"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/mergers"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/mergers"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/serial"
 	"github.com/v2fly/v2ray-core/v4/infra/conf/serial"
+	"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
 )
 )
 
 
 // LoadConfig load config files to *conf.Config, it will:
 // LoadConfig load config files to *conf.Config, it will:

+ 2 - 1
main/v2binding/v2api/api.go

@@ -1,8 +1,9 @@
 package main
 package main
 
 
 import (
 import (
-	"github.com/v2fly/v2ray-core/v4/main/v2binding"
 	"time"
 	"time"
+
+	"github.com/v2fly/v2ray-core/v4/main/v2binding"
 )
 )
 
 
 func main() {
 func main() {

+ 2 - 1
main/v2binding/v2binding.go

@@ -1,6 +1,8 @@
 package v2binding
 package v2binding
 
 
 import (
 import (
+	"google.golang.org/protobuf/types/known/anypb"
+
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/commander"
 	"github.com/v2fly/v2ray-core/v4/app/commander"
 	"github.com/v2fly/v2ray-core/v4/app/dispatcher"
 	"github.com/v2fly/v2ray-core/v4/app/dispatcher"
@@ -13,7 +15,6 @@ import (
 	_ "github.com/v2fly/v2ray-core/v4/main/distro/all"
 	_ "github.com/v2fly/v2ray-core/v4/main/distro/all"
 	"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
 	"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
 	"github.com/v2fly/v2ray-core/v4/proxy/dokodemo"
 	"github.com/v2fly/v2ray-core/v4/proxy/dokodemo"
-	"google.golang.org/protobuf/types/known/anypb"
 )
 )
 
 
 type bindingInstance struct {
 type bindingInstance struct {

+ 1 - 1
proxy/dns/dns_test.go

@@ -1,13 +1,13 @@
 package dns_test
 package dns_test
 
 
 import (
 import (
-	"google.golang.org/protobuf/types/known/anypb"
 	"strconv"
 	"strconv"
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
 	"github.com/google/go-cmp/cmp"
 	"github.com/google/go-cmp/cmp"
 	"github.com/miekg/dns"
 	"github.com/miekg/dns"
+	"google.golang.org/protobuf/types/known/anypb"
 
 
 	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"

+ 1 - 0
proxy/socks/simplified/config.go

@@ -2,6 +2,7 @@ package simplified
 
 
 import (
 import (
 	"context"
 	"context"
+
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/proxy/socks"
 	"github.com/v2fly/v2ray-core/v4/proxy/socks"

+ 1 - 1
proxy/vmess/inbound/inbound.go

@@ -4,7 +4,6 @@ package inbound
 
 
 import (
 import (
 	"context"
 	"context"
-	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"io"
 	"io"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
@@ -18,6 +17,7 @@ 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"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 	"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/session"
 	"github.com/v2fly/v2ray-core/v4/common/session"
 	"github.com/v2fly/v2ray-core/v4/common/signal"
 	"github.com/v2fly/v2ray-core/v4/common/signal"
 	"github.com/v2fly/v2ray-core/v4/common/task"
 	"github.com/v2fly/v2ray-core/v4/common/task"

+ 1 - 1
proxy/vmess/outbound/outbound.go

@@ -6,7 +6,6 @@ import (
 	"context"
 	"context"
 	"crypto/hmac"
 	"crypto/hmac"
 	"crypto/sha256"
 	"crypto/sha256"
-	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"hash/crc64"
 	"hash/crc64"
 	"time"
 	"time"
 
 
@@ -17,6 +16,7 @@ import (
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 	"github.com/v2fly/v2ray-core/v4/common/platform"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/protocol"
 	"github.com/v2fly/v2ray-core/v4/common/retry"
 	"github.com/v2fly/v2ray-core/v4/common/retry"
+	"github.com/v2fly/v2ray-core/v4/common/serial"
 	"github.com/v2fly/v2ray-core/v4/common/session"
 	"github.com/v2fly/v2ray-core/v4/common/session"
 	"github.com/v2fly/v2ray-core/v4/common/signal"
 	"github.com/v2fly/v2ray-core/v4/common/signal"
 	"github.com/v2fly/v2ray-core/v4/common/task"
 	"github.com/v2fly/v2ray-core/v4/common/task"

+ 1 - 1
testing/scenarios/command_test.go

@@ -3,7 +3,6 @@ package scenarios
 import (
 import (
 	"context"
 	"context"
 	"fmt"
 	"fmt"
-	"google.golang.org/protobuf/types/known/anypb"
 	"io"
 	"io"
 	"strings"
 	"strings"
 	"testing"
 	"testing"
@@ -12,6 +11,7 @@ import (
 	"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"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc"
+	"google.golang.org/protobuf/types/known/anypb"
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/commander"
 	"github.com/v2fly/v2ray-core/v4/app/commander"

+ 2 - 2
testing/scenarios/dns_test.go

@@ -2,17 +2,17 @@ package scenarios
 
 
 import (
 import (
 	"fmt"
 	"fmt"
-	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
-	"google.golang.org/protobuf/types/known/anypb"
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
 	xproxy "golang.org/x/net/proxy"
 	xproxy "golang.org/x/net/proxy"
+	"google.golang.org/protobuf/types/known/anypb"
 
 
 	core "github.com/v2fly/v2ray-core/v4"
 	core "github.com/v2fly/v2ray-core/v4"
 	"github.com/v2fly/v2ray-core/v4/app/dns"
 	"github.com/v2fly/v2ray-core/v4/app/dns"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/proxyman"
 	"github.com/v2fly/v2ray-core/v4/app/router"
 	"github.com/v2fly/v2ray-core/v4/app/router"
+	"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
 	"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/serial"
 	"github.com/v2fly/v2ray-core/v4/common/serial"

Some files were not shown because too many files changed in this diff