Browse Source

Style: format code

Arthur Morgan 4 years ago
parent
commit
ffc2f7c4e2
78 changed files with 112 additions and 39 deletions
  1. 2 1
      app/commander/service.go
  2. 2 1
      app/dns/dnscommon.go
  3. 2 1
      app/dns/dnscommon_test.go
  4. 2 1
      app/dns/dohdns.go
  5. 2 1
      app/dns/udpns.go
  6. 1 0
      app/log/log_test.go
  7. 1 0
      app/reverse/bridge.go
  8. 1 0
      app/reverse/portal.go
  9. 3 2
      app/router/command/command_test.go
  10. 1 0
      app/router/condition_geoip_test.go
  11. 1 0
      app/router/router_test.go
  12. 1 0
      common/buf/buffer_test.go
  13. 1 0
      common/buf/multi_buffer_test.go
  14. 2 3
      common/buf/readv_posix.go
  15. 1 0
      common/buf/readv_reader.go
  16. 1 0
      common/buf/readv_reader_wasm.go
  17. 3 1
      common/buf/readv_test.go
  18. 1 0
      common/buf/readv_unix.go
  19. 1 0
      common/crypto/internal/chacha_core_gen.go
  20. 1 0
      common/mux/client_test.go
  21. 1 0
      common/platform/ctlcmd/attr_other.go
  22. 1 0
      common/platform/ctlcmd/attr_windows.go
  23. 1 0
      common/platform/others.go
  24. 1 0
      common/platform/windows.go
  25. 2 1
      common/protocol/dns/io.go
  26. 1 0
      infra/conf/dns_proxy.go
  27. 1 0
      infra/conf/dns_test.go
  28. 1 0
      infra/conf/dokodemo.go
  29. 1 0
      infra/conf/fakedns.go
  30. 1 0
      infra/conf/freedom.go
  31. 1 0
      infra/conf/general_test.go
  32. 1 0
      infra/conf/http.go
  33. 1 0
      infra/conf/reverse.go
  34. 2 1
      infra/conf/serial/builder.go
  35. 1 0
      infra/conf/socks.go
  36. 1 0
      infra/conf/transport_internet.go
  37. 1 0
      infra/conf/transport_test.go
  38. 2 1
      infra/conf/xray.go
  39. 1 0
      infra/conf/xray_test.go
  40. 2 1
      main/commands/all/convert.go
  41. 1 0
      main/main_test.go
  42. 1 0
      proxy/dokodemo/fakeudp_linux.go
  43. 1 0
      proxy/dokodemo/fakeudp_other.go
  44. 1 0
      proxy/trojan/protocol_test.go
  45. 2 1
      proxy/vmess/encoding/server.go
  46. 1 1
      proxy/vmess/inbound/inbound.go
  47. 1 0
      testing/scenarios/common.go
  48. 1 0
      testing/scenarios/common_coverage.go
  49. 1 0
      testing/scenarios/common_regular.go
  50. 2 1
      testing/scenarios/dns_test.go
  51. 2 1
      testing/scenarios/feature_test.go
  52. 10 10
      testing/scenarios/shadowsocks_test.go
  53. 2 1
      testing/scenarios/vmess_test.go
  54. 2 2
      transport/internet/domainsocket/dial.go
  55. 2 2
      transport/internet/domainsocket/listener.go
  56. 2 2
      transport/internet/domainsocket/listener_test.go
  57. 1 0
      transport/internet/filelocker_other.go
  58. 2 1
      transport/internet/http/dialer.go
  59. 1 0
      transport/internet/kcp/xor.go
  60. 2 1
      transport/internet/quic/config.go
  61. 1 0
      transport/internet/quic/conn.go
  62. 1 0
      transport/internet/quic/dialer.go
  63. 1 0
      transport/internet/quic/hub.go
  64. 1 0
      transport/internet/sockopt_other.go
  65. 1 0
      transport/internet/sockopt_test.go
  66. 1 0
      transport/internet/system_listener.go
  67. 1 0
      transport/internet/tcp/sockopt_freebsd.go
  68. 1 0
      transport/internet/tcp/sockopt_linux.go
  69. 1 0
      transport/internet/tcp/sockopt_linux_test.go
  70. 1 0
      transport/internet/tcp/sockopt_other.go
  71. 1 0
      transport/internet/tls/config_other.go
  72. 1 0
      transport/internet/tls/config_windows.go
  73. 1 0
      transport/internet/udp/hub_freebsd.go
  74. 3 1
      transport/internet/udp/hub_linux.go
  75. 1 0
      transport/internet/udp/hub_other.go
  76. 1 0
      transport/internet/websocket/connection.go
  77. 1 0
      transport/internet/xtls/config_other.go
  78. 1 0
      transport/internet/xtls/config_windows.go

+ 2 - 1
app/commander/service.go

@@ -3,9 +3,10 @@ package commander
 import (
 	"context"
 
-	"github.com/xtls/xray-core/common"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/reflection"
+
+	"github.com/xtls/xray-core/common"
 )
 
 // Service is a Commander service.

+ 2 - 1
app/dns/dnscommon.go

@@ -5,11 +5,12 @@ import (
 	"strings"
 	"time"
 
+	"golang.org/x/net/dns/dnsmessage"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/errors"
 	"github.com/xtls/xray-core/common/net"
 	dns_feature "github.com/xtls/xray-core/features/dns"
-	"golang.org/x/net/dns/dnsmessage"
 )
 
 // Fqdn normalize domain make sure it ends with '.'

+ 2 - 1
app/dns/dnscommon_test.go

@@ -7,10 +7,11 @@ import (
 
 	"github.com/google/go-cmp/cmp"
 	"github.com/miekg/dns"
+	"golang.org/x/net/dns/dnsmessage"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/net"
 	dns_feature "github.com/xtls/xray-core/features/dns"
-	"golang.org/x/net/dns/dnsmessage"
 )
 
 func Test_parseResponse(t *testing.T) {

+ 2 - 1
app/dns/dohdns.go

@@ -12,6 +12,8 @@ import (
 	"sync/atomic"
 	"time"
 
+	"golang.org/x/net/dns/dnsmessage"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/log"
 	"github.com/xtls/xray-core/common/net"
@@ -23,7 +25,6 @@ import (
 	dns_feature "github.com/xtls/xray-core/features/dns"
 	"github.com/xtls/xray-core/features/routing"
 	"github.com/xtls/xray-core/transport/internet"
-	"golang.org/x/net/dns/dnsmessage"
 )
 
 // DoHNameServer implemented DNS over HTTPS (RFC8484) Wire Format,

+ 2 - 1
app/dns/udpns.go

@@ -7,6 +7,8 @@ import (
 	"sync/atomic"
 	"time"
 
+	"golang.org/x/net/dns/dnsmessage"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/log"
 	"github.com/xtls/xray-core/common/net"
@@ -18,7 +20,6 @@ import (
 	dns_feature "github.com/xtls/xray-core/features/dns"
 	"github.com/xtls/xray-core/features/routing"
 	"github.com/xtls/xray-core/transport/internet/udp"
-	"golang.org/x/net/dns/dnsmessage"
 )
 
 type ClassicNameServer struct {

+ 1 - 0
app/log/log_test.go

@@ -5,6 +5,7 @@ import (
 	"testing"
 
 	"github.com/golang/mock/gomock"
+
 	"github.com/xtls/xray-core/app/log"
 	"github.com/xtls/xray-core/common"
 	clog "github.com/xtls/xray-core/common/log"

+ 1 - 0
app/reverse/bridge.go

@@ -5,6 +5,7 @@ import (
 	"time"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/common/mux"
 	"github.com/xtls/xray-core/common/net"
 	"github.com/xtls/xray-core/common/session"

+ 1 - 0
app/reverse/portal.go

@@ -6,6 +6,7 @@ import (
 	"time"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/buf"
 	"github.com/xtls/xray-core/common/mux"

+ 3 - 2
app/router/command/command_test.go

@@ -8,6 +8,9 @@ import (
 	"github.com/golang/mock/gomock"
 	"github.com/google/go-cmp/cmp"
 	"github.com/google/go-cmp/cmp/cmpopts"
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/test/bufconn"
+
 	"github.com/xtls/xray-core/app/router"
 	. "github.com/xtls/xray-core/app/router/command"
 	"github.com/xtls/xray-core/app/stats"
@@ -15,8 +18,6 @@ import (
 	"github.com/xtls/xray-core/common/net"
 	"github.com/xtls/xray-core/features/routing"
 	"github.com/xtls/xray-core/testing/mocks"
-	"google.golang.org/grpc"
-	"google.golang.org/grpc/test/bufconn"
 )
 
 func TestServiceSubscribeRoutingStats(t *testing.T) {

+ 1 - 0
app/router/condition_geoip_test.go

@@ -6,6 +6,7 @@ import (
 	"testing"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/app/router"
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/net"

+ 1 - 0
app/router/router_test.go

@@ -5,6 +5,7 @@ import (
 	"testing"
 
 	"github.com/golang/mock/gomock"
+
 	. "github.com/xtls/xray-core/app/router"
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/net"

+ 1 - 0
common/buf/buffer_test.go

@@ -6,6 +6,7 @@ import (
 	"testing"
 
 	"github.com/google/go-cmp/cmp"
+
 	"github.com/xtls/xray-core/common"
 	. "github.com/xtls/xray-core/common/buf"
 )

+ 1 - 0
common/buf/multi_buffer_test.go

@@ -9,6 +9,7 @@ import (
 	"testing"
 
 	"github.com/google/go-cmp/cmp"
+
 	"github.com/xtls/xray-core/common"
 	. "github.com/xtls/xray-core/common/buf"
 )

+ 2 - 3
common/buf/readv_posix.go

@@ -1,6 +1,5 @@
-// +build !windows
-// +build !wasm
-// +build !illumos
+//go:build !windows && !wasm && !illumos
+// +build !windows,!wasm,!illumos
 
 package buf
 

+ 1 - 0
common/buf/readv_reader.go

@@ -1,3 +1,4 @@
+//go:build !wasm
 // +build !wasm
 
 package buf

+ 1 - 0
common/buf/readv_reader_wasm.go

@@ -1,3 +1,4 @@
+//go:build wasm
 // +build wasm
 
 package buf

+ 3 - 1
common/buf/readv_test.go

@@ -1,3 +1,4 @@
+//go:build !wasm
 // +build !wasm
 
 package buf_test
@@ -9,10 +10,11 @@ import (
 
 	"github.com/google/go-cmp/cmp"
 
+	"golang.org/x/sync/errgroup"
+
 	"github.com/xtls/xray-core/common"
 	. "github.com/xtls/xray-core/common/buf"
 	"github.com/xtls/xray-core/testing/servers/tcp"
-	"golang.org/x/sync/errgroup"
 )
 
 func TestReadvReader(t *testing.T) {

+ 1 - 0
common/buf/readv_unix.go

@@ -1,3 +1,4 @@
+//go:build illumos
 // +build illumos
 
 package buf

+ 1 - 0
common/crypto/internal/chacha_core_gen.go

@@ -1,3 +1,4 @@
+//go:build generate
 // +build generate
 
 package main

+ 1 - 0
common/mux/client_test.go

@@ -6,6 +6,7 @@ import (
 	"time"
 
 	"github.com/golang/mock/gomock"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/errors"
 	"github.com/xtls/xray-core/common/mux"

+ 1 - 0
common/platform/ctlcmd/attr_other.go

@@ -1,3 +1,4 @@
+//go:build !windows
 // +build !windows
 
 package ctlcmd

+ 1 - 0
common/platform/ctlcmd/attr_windows.go

@@ -1,3 +1,4 @@
+//go:build windows
 // +build windows
 
 package ctlcmd

+ 1 - 0
common/platform/others.go

@@ -1,3 +1,4 @@
+//go:build !windows
 // +build !windows
 
 package platform

+ 1 - 0
common/platform/windows.go

@@ -1,3 +1,4 @@
+//go:build windows
 // +build windows
 
 package platform

+ 2 - 1
common/protocol/dns/io.go

@@ -4,10 +4,11 @@ import (
 	"encoding/binary"
 	"sync"
 
+	"golang.org/x/net/dns/dnsmessage"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/buf"
 	"github.com/xtls/xray-core/common/serial"
-	"golang.org/x/net/dns/dnsmessage"
 )
 
 func PackMessage(msg *dnsmessage.Message) (*buf.Buffer, error) {

+ 1 - 0
infra/conf/dns_proxy.go

@@ -2,6 +2,7 @@ package conf
 
 import (
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/common/net"
 	"github.com/xtls/xray-core/proxy/dns"
 )

+ 1 - 0
infra/conf/dns_test.go

@@ -7,6 +7,7 @@ import (
 	"testing"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/app/dns"
 	"github.com/xtls/xray-core/app/router"
 	"github.com/xtls/xray-core/common"

+ 1 - 0
infra/conf/dokodemo.go

@@ -2,6 +2,7 @@ package conf
 
 import (
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/proxy/dokodemo"
 )
 

+ 1 - 0
infra/conf/fakedns.go

@@ -2,6 +2,7 @@ package conf
 
 import (
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/app/dns/fakedns"
 	"github.com/xtls/xray-core/features/dns"
 )

+ 1 - 0
infra/conf/freedom.go

@@ -5,6 +5,7 @@ import (
 	"strings"
 
 	"github.com/golang/protobuf/proto"
+
 	v2net "github.com/xtls/xray-core/common/net"
 	"github.com/xtls/xray-core/common/protocol"
 	"github.com/xtls/xray-core/proxy/freedom"

+ 1 - 0
infra/conf/general_test.go

@@ -5,6 +5,7 @@ import (
 	"testing"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/common"
 	. "github.com/xtls/xray-core/infra/conf"
 )

+ 1 - 0
infra/conf/http.go

@@ -4,6 +4,7 @@ import (
 	"encoding/json"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/common/protocol"
 	"github.com/xtls/xray-core/common/serial"
 	"github.com/xtls/xray-core/proxy/http"

+ 1 - 0
infra/conf/reverse.go

@@ -2,6 +2,7 @@ package conf
 
 import (
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/app/reverse"
 )
 

+ 2 - 1
infra/conf/serial/builder.go

@@ -1,10 +1,11 @@
 package serial
 
 import (
+	"io"
+
 	"github.com/xtls/xray-core/core"
 	"github.com/xtls/xray-core/infra/conf"
 	"github.com/xtls/xray-core/main/confloader"
-	"io"
 )
 
 func BuildConfig(files []string, formats []string) (*core.Config, error) {

+ 1 - 0
infra/conf/socks.go

@@ -4,6 +4,7 @@ import (
 	"encoding/json"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/common/protocol"
 	"github.com/xtls/xray-core/common/serial"
 	"github.com/xtls/xray-core/proxy/socks"

+ 1 - 0
infra/conf/transport_internet.go

@@ -8,6 +8,7 @@ import (
 	"strings"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/common/platform/filesystem"
 	"github.com/xtls/xray-core/common/protocol"
 	"github.com/xtls/xray-core/common/serial"

+ 1 - 0
infra/conf/transport_test.go

@@ -5,6 +5,7 @@ import (
 	"testing"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/common/protocol"
 	"github.com/xtls/xray-core/common/serial"
 	. "github.com/xtls/xray-core/infra/conf"

+ 2 - 1
infra/conf/xray.go

@@ -2,11 +2,12 @@ package conf
 
 import (
 	"encoding/json"
-	"github.com/xtls/xray-core/transport/internet"
 	"log"
 	"os"
 	"strings"
 
+	"github.com/xtls/xray-core/transport/internet"
+
 	"github.com/xtls/xray-core/app/dispatcher"
 	"github.com/xtls/xray-core/app/proxyman"
 	"github.com/xtls/xray-core/app/stats"

+ 1 - 0
infra/conf/xray_test.go

@@ -7,6 +7,7 @@ import (
 
 	"github.com/golang/protobuf/proto"
 	"github.com/google/go-cmp/cmp"
+
 	"github.com/xtls/xray-core/app/dispatcher"
 	"github.com/xtls/xray-core/app/log"
 	"github.com/xtls/xray-core/app/proxyman"

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

@@ -11,12 +11,13 @@ import (
 	"strings"
 	"time"
 
+	"google.golang.org/protobuf/proto"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/buf"
 	"github.com/xtls/xray-core/infra/conf"
 	"github.com/xtls/xray-core/infra/conf/serial"
 	"github.com/xtls/xray-core/main/commands/base"
-	"google.golang.org/protobuf/proto"
 )
 
 var cmdConvert = &base.Command{

+ 1 - 0
main/main_test.go

@@ -1,3 +1,4 @@
+//go:build coveragemain
 // +build coveragemain
 
 package main

+ 1 - 0
proxy/dokodemo/fakeudp_linux.go

@@ -1,3 +1,4 @@
+//go:build linux
 // +build linux
 
 package dokodemo

+ 1 - 0
proxy/dokodemo/fakeudp_other.go

@@ -1,3 +1,4 @@
+//go:build !linux
 // +build !linux
 
 package dokodemo

+ 1 - 0
proxy/trojan/protocol_test.go

@@ -4,6 +4,7 @@ import (
 	"testing"
 
 	"github.com/google/go-cmp/cmp"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/buf"
 	"github.com/xtls/xray-core/common/net"

+ 2 - 1
proxy/vmess/encoding/server.go

@@ -13,6 +13,8 @@ import (
 	"sync"
 	"time"
 
+	"golang.org/x/crypto/chacha20poly1305"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/bitmask"
 	"github.com/xtls/xray-core/common/buf"
@@ -23,7 +25,6 @@ import (
 	"github.com/xtls/xray-core/common/task"
 	"github.com/xtls/xray-core/proxy/vmess"
 	vmessaead "github.com/xtls/xray-core/proxy/vmess/aead"
-	"golang.org/x/crypto/chacha20poly1305"
 )
 
 type sessionID struct {

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

@@ -31,7 +31,7 @@ import (
 )
 
 var (
-	aeadForced = false
+	aeadForced     = false
 	aeadForced2022 = false
 )
 

+ 1 - 0
testing/scenarios/common.go

@@ -14,6 +14,7 @@ import (
 	"time"
 
 	"github.com/golang/protobuf/proto"
+
 	"github.com/xtls/xray-core/app/dispatcher"
 	"github.com/xtls/xray-core/app/proxyman"
 	"github.com/xtls/xray-core/common"

+ 1 - 0
testing/scenarios/common_coverage.go

@@ -1,3 +1,4 @@
+//go:build coverage
 // +build coverage
 
 package scenarios

+ 1 - 0
testing/scenarios/common_regular.go

@@ -1,3 +1,4 @@
+//go:build !coverage
 // +build !coverage
 
 package scenarios

+ 2 - 1
testing/scenarios/dns_test.go

@@ -5,6 +5,8 @@ import (
 	"testing"
 	"time"
 
+	xproxy "golang.org/x/net/proxy"
+
 	"github.com/xtls/xray-core/app/dns"
 	"github.com/xtls/xray-core/app/proxyman"
 	"github.com/xtls/xray-core/app/router"
@@ -16,7 +18,6 @@ import (
 	"github.com/xtls/xray-core/proxy/freedom"
 	"github.com/xtls/xray-core/proxy/socks"
 	"github.com/xtls/xray-core/testing/servers/tcp"
-	xproxy "golang.org/x/net/proxy"
 )
 
 func TestResolveIP(t *testing.T) {

+ 2 - 1
testing/scenarios/feature_test.go

@@ -8,6 +8,8 @@ import (
 	"testing"
 	"time"
 
+	xproxy "golang.org/x/net/proxy"
+
 	"github.com/xtls/xray-core/app/dispatcher"
 	"github.com/xtls/xray-core/app/log"
 	"github.com/xtls/xray-core/app/proxyman"
@@ -32,7 +34,6 @@ import (
 	"github.com/xtls/xray-core/testing/servers/tcp"
 	"github.com/xtls/xray-core/testing/servers/udp"
 	"github.com/xtls/xray-core/transport/internet"
-	xproxy "golang.org/x/net/proxy"
 )
 
 func TestPassiveConnection(t *testing.T) {

+ 10 - 10
testing/scenarios/shadowsocks_test.go

@@ -67,8 +67,8 @@ func TestShadowsocksChaCha20Poly1305TCP(t *testing.T) {
 					Listen:    net.NewIPOrDomain(net.LocalHostIP),
 				}),
 				ProxySettings: serial.ToTypedMessage(&dokodemo.Config{
-					Address: net.NewIPOrDomain(dest.Address),
-					Port:    uint32(dest.Port),
+					Address:  net.NewIPOrDomain(dest.Address),
+					Port:     uint32(dest.Port),
 					Networks: []net.Network{net.Network_TCP},
 				}),
 			},
@@ -163,8 +163,8 @@ func TestShadowsocksAES256GCMTCP(t *testing.T) {
 					Listen:    net.NewIPOrDomain(net.LocalHostIP),
 				}),
 				ProxySettings: serial.ToTypedMessage(&dokodemo.Config{
-					Address: net.NewIPOrDomain(dest.Address),
-					Port:    uint32(dest.Port),
+					Address:  net.NewIPOrDomain(dest.Address),
+					Port:     uint32(dest.Port),
 					Networks: []net.Network{net.Network_TCP},
 				}),
 			},
@@ -260,8 +260,8 @@ func TestShadowsocksAES128GCMUDP(t *testing.T) {
 					Listen:    net.NewIPOrDomain(net.LocalHostIP),
 				}),
 				ProxySettings: serial.ToTypedMessage(&dokodemo.Config{
-					Address: net.NewIPOrDomain(dest.Address),
-					Port:    uint32(dest.Port),
+					Address:  net.NewIPOrDomain(dest.Address),
+					Port:     uint32(dest.Port),
 					Networks: []net.Network{net.Network_UDP},
 				}),
 			},
@@ -356,8 +356,8 @@ func TestShadowsocksAES128GCMUDPMux(t *testing.T) {
 					Listen:    net.NewIPOrDomain(net.LocalHostIP),
 				}),
 				ProxySettings: serial.ToTypedMessage(&dokodemo.Config{
-					Address: net.NewIPOrDomain(dest.Address),
-					Port:    uint32(dest.Port),
+					Address:  net.NewIPOrDomain(dest.Address),
+					Port:     uint32(dest.Port),
 					Networks: []net.Network{net.Network_UDP},
 				}),
 			},
@@ -447,8 +447,8 @@ func TestShadowsocksNone(t *testing.T) {
 					Listen:    net.NewIPOrDomain(net.LocalHostIP),
 				}),
 				ProxySettings: serial.ToTypedMessage(&dokodemo.Config{
-					Address: net.NewIPOrDomain(dest.Address),
-					Port:    uint32(dest.Port),
+					Address:  net.NewIPOrDomain(dest.Address),
+					Port:     uint32(dest.Port),
 					Networks: []net.Network{net.Network_TCP},
 				}),
 			},

+ 2 - 1
testing/scenarios/vmess_test.go

@@ -5,6 +5,8 @@ import (
 	"testing"
 	"time"
 
+	"golang.org/x/sync/errgroup"
+
 	"github.com/xtls/xray-core/app/log"
 	"github.com/xtls/xray-core/app/proxyman"
 	"github.com/xtls/xray-core/common"
@@ -23,7 +25,6 @@ import (
 	"github.com/xtls/xray-core/testing/servers/udp"
 	"github.com/xtls/xray-core/transport/internet"
 	"github.com/xtls/xray-core/transport/internet/kcp"
-	"golang.org/x/sync/errgroup"
 )
 
 func TestVMessDynamicPort(t *testing.T) {

+ 2 - 2
transport/internet/domainsocket/dial.go

@@ -1,5 +1,5 @@
-// +build !windows
-// +build !wasm
+//go:build !windows && !wasm
+// +build !windows,!wasm
 
 package domainsocket
 

+ 2 - 2
transport/internet/domainsocket/listener.go

@@ -1,5 +1,5 @@
-// +build !windows
-// +build !wasm
+//go:build !windows && !wasm
+// +build !windows,!wasm
 
 package domainsocket
 

+ 2 - 2
transport/internet/domainsocket/listener_test.go

@@ -1,5 +1,5 @@
-// +build !windows
-// +build !android
+//go:build !windows && !android
+// +build !windows,!android
 
 package domainsocket_test
 

+ 1 - 0
transport/internet/filelocker_other.go

@@ -1,3 +1,4 @@
+//go:build !windows
 // +build !windows
 
 package internet

+ 2 - 1
transport/internet/http/dialer.go

@@ -10,6 +10,8 @@ import (
 
 	"github.com/xtls/xray-core/transport/internet/stat"
 
+	"golang.org/x/net/http2"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/buf"
 	"github.com/xtls/xray-core/common/net"
@@ -18,7 +20,6 @@ import (
 	"github.com/xtls/xray-core/transport/internet"
 	"github.com/xtls/xray-core/transport/internet/tls"
 	"github.com/xtls/xray-core/transport/pipe"
-	"golang.org/x/net/http2"
 )
 
 type dialerConf struct {

+ 1 - 0
transport/internet/kcp/xor.go

@@ -1,3 +1,4 @@
+//go:build !amd64
 // +build !amd64
 
 package kcp

+ 2 - 1
transport/internet/quic/config.go

@@ -5,10 +5,11 @@ import (
 	"crypto/cipher"
 	"crypto/sha256"
 
+	"golang.org/x/crypto/chacha20poly1305"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/protocol"
 	"github.com/xtls/xray-core/transport/internet"
-	"golang.org/x/crypto/chacha20poly1305"
 )
 
 func getAuth(config *Config) (cipher.AEAD, error) {

+ 1 - 0
transport/internet/quic/conn.go

@@ -7,6 +7,7 @@ import (
 	"time"
 
 	"github.com/lucas-clemente/quic-go"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/buf"
 	"github.com/xtls/xray-core/common/net"

+ 1 - 0
transport/internet/quic/dialer.go

@@ -8,6 +8,7 @@ import (
 	"github.com/xtls/xray-core/transport/internet/stat"
 
 	"github.com/lucas-clemente/quic-go"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/net"
 	"github.com/xtls/xray-core/common/task"

+ 1 - 0
transport/internet/quic/hub.go

@@ -5,6 +5,7 @@ import (
 	"time"
 
 	"github.com/lucas-clemente/quic-go"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/net"
 	"github.com/xtls/xray-core/common/protocol/tls/cert"

+ 1 - 0
transport/internet/sockopt_other.go

@@ -1,3 +1,4 @@
+//go:build js || dragonfly || netbsd || openbsd || solaris
 // +build js dragonfly netbsd openbsd solaris
 
 package internet

+ 1 - 0
transport/internet/sockopt_test.go

@@ -5,6 +5,7 @@ import (
 	"testing"
 
 	"github.com/google/go-cmp/cmp"
+
 	"github.com/xtls/xray-core/common"
 	"github.com/xtls/xray-core/common/buf"
 	"github.com/xtls/xray-core/testing/servers/tcp"

+ 1 - 0
transport/internet/system_listener.go

@@ -6,6 +6,7 @@ import (
 	"syscall"
 
 	"github.com/pires/go-proxyproto"
+
 	"github.com/xtls/xray-core/common/net"
 	"github.com/xtls/xray-core/common/session"
 )

+ 1 - 0
transport/internet/tcp/sockopt_freebsd.go

@@ -1,3 +1,4 @@
+//go:build freebsd
 // +build freebsd
 
 package tcp

+ 1 - 0
transport/internet/tcp/sockopt_linux.go

@@ -1,3 +1,4 @@
+//go:build linux
 // +build linux
 
 package tcp

+ 1 - 0
transport/internet/tcp/sockopt_linux_test.go

@@ -1,3 +1,4 @@
+//go:build linux
 // +build linux
 
 package tcp_test

+ 1 - 0
transport/internet/tcp/sockopt_other.go

@@ -1,3 +1,4 @@
+//go:build !linux && !freebsd
 // +build !linux,!freebsd
 
 package tcp

+ 1 - 0
transport/internet/tls/config_other.go

@@ -1,3 +1,4 @@
+//go:build !windows
 // +build !windows
 
 package tls

+ 1 - 0
transport/internet/tls/config_windows.go

@@ -1,3 +1,4 @@
+//go:build windows
 // +build windows
 
 package tls

+ 1 - 0
transport/internet/udp/hub_freebsd.go

@@ -1,3 +1,4 @@
+//go:build freebsd
 // +build freebsd
 
 package udp

+ 3 - 1
transport/internet/udp/hub_linux.go

@@ -1,3 +1,4 @@
+//go:build linux
 // +build linux
 
 package udp
@@ -5,8 +6,9 @@ package udp
 import (
 	"syscall"
 
-	"github.com/xtls/xray-core/common/net"
 	"golang.org/x/sys/unix"
+
+	"github.com/xtls/xray-core/common/net"
 )
 
 func RetrieveOriginalDest(oob []byte) net.Destination {

+ 1 - 0
transport/internet/udp/hub_other.go

@@ -1,3 +1,4 @@
+//go:build !linux && !freebsd
 // +build !linux,!freebsd
 
 package udp

+ 1 - 0
transport/internet/websocket/connection.go

@@ -6,6 +6,7 @@ import (
 	"time"
 
 	"github.com/gorilla/websocket"
+
 	"github.com/xtls/xray-core/common/buf"
 	"github.com/xtls/xray-core/common/errors"
 	"github.com/xtls/xray-core/common/serial"

+ 1 - 0
transport/internet/xtls/config_other.go

@@ -1,3 +1,4 @@
+//go:build !windows
 // +build !windows
 
 package xtls

+ 1 - 0
transport/internet/xtls/config_windows.go

@@ -1,3 +1,4 @@
+//go:build windows
 // +build windows
 
 package xtls