秋のかえで 3 years ago
parent
commit
423d566024

+ 1 - 1
app/stats/channel_test.go

@@ -203,7 +203,7 @@ func TestStatsChannelBlocking(t *testing.T) {
 
 	// Test blocking channel publishing
 	go func() {
-		// Dummy messsage with no subscriber receiving, will block broadcasting goroutine
+		// Dummy message with no subscriber receiving, will block broadcasting goroutine
 		c.Publish(context.Background(), nil)
 
 		<-pauseCh

+ 3 - 3
common/crypto/chacha20_test.go

@@ -48,9 +48,9 @@ func TestChaCha20Stream(t *testing.T) {
 	for _, c := range cases {
 		s := NewChaCha20Stream(c.key, c.iv)
 		input := make([]byte, len(c.output))
-		actualOutout := make([]byte, len(c.output))
-		s.XORKeyStream(actualOutout, input)
-		if r := cmp.Diff(c.output, actualOutout); r != "" {
+		actualOutput := make([]byte, len(c.output))
+		s.XORKeyStream(actualOutput, input)
+		if r := cmp.Diff(c.output, actualOutput); r != "" {
 			t.Fatal(r)
 		}
 	}

+ 1 - 1
common/protocol/tls/cert/cert.go

@@ -18,7 +18,7 @@ import (
 //go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
 
 type Certificate struct {
-	// Cerificate in ASN.1 DER format
+	// Certificate in ASN.1 DER format
 	Certificate []byte
 	// Private key in ASN.1 DER format
 	PrivateKey []byte

+ 1 - 1
common/signal/timer_test.go

@@ -29,7 +29,7 @@ func TestActivityTimerUpdate(t *testing.T) {
 	timer.SetTimeout(time.Second * 1)
 	time.Sleep(time.Second * 2)
 	if ctx.Err() == nil {
-		t.Error("expcted some error, but got nil")
+		t.Error("expected some error, but got nil")
 	}
 	runtime.KeepAlive(timer)
 }

+ 1 - 1
features/routing/context.go

@@ -35,7 +35,7 @@ type Context interface {
 	// GetUser returns the user email from the connection content, if exists.
 	GetUser() string
 
-	// GetAttributes returns extra attributes from the conneciont content.
+	// GetAttributes returns extra attributes from the connection content.
 	GetAttributes() map[string]string
 
 	// GetSkipDNSResolve returns a flag switch for weather skip dns resolve during route pick.

+ 1 - 1
features/stats/stats.go

@@ -47,7 +47,7 @@ func SubscribeRunnableChannel(c Channel) (chan interface{}, error) {
 	return c.Subscribe()
 }
 
-// UnsubscribeClosableChannel unsubcribes the channel and close it if there is no more subscriber.
+// UnsubscribeClosableChannel unsubscribes the channel and close it if there is no more subscriber.
 func UnsubscribeClosableChannel(c Channel, sub chan interface{}) error {
 	if err := c.Unsubscribe(sub); err != nil {
 		return err

+ 2 - 2
main/formats/formats.go

@@ -24,13 +24,13 @@ func init() {
 }
 
 func makeMergeLoader(formatName string) (*core.ConfigFormat, error) {
-	extenstoins, err := mergers.GetExtensions(formatName)
+	extensions, err := mergers.GetExtensions(formatName)
 	if err != nil {
 		return nil, err
 	}
 	return &core.ConfigFormat{
 		Name:      []string{formatName},
-		Extension: extenstoins,
+		Extension: extensions,
 		Loader:    makeLoaderFunc(formatName),
 	}, nil
 }

+ 2 - 2
transport/internet/domainsocket/config.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // 	protoc-gen-go v1.27.1
-// 	protoc        v3.17.3
+// 	protoc        v3.19.1
 // source: transport/internet/domainsocket/config.proto
 
 package domainsocket
@@ -28,7 +28,7 @@ type Config struct {
 	// Path of the domain socket. This overrides the IP/Port parameter from
 	// upstream caller.
 	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
-	// Abstract speicifies whether to use abstract namespace or not.
+	// Abstract specifies whether to use abstract namespace or not.
 	// Traditionally Unix domain socket is file system based. Abstract domain
 	// socket can be used without acquiring file lock.
 	Abstract bool `protobuf:"varint,2,opt,name=abstract,proto3" json:"abstract,omitempty"`

+ 1 - 1
transport/internet/domainsocket/config.proto

@@ -10,7 +10,7 @@ message Config {
   // Path of the domain socket. This overrides the IP/Port parameter from
   // upstream caller.
   string path = 1;
-  // Abstract speicifies whether to use abstract namespace or not.
+  // Abstract specifies whether to use abstract namespace or not.
   // Traditionally Unix domain socket is file system based. Abstract domain
   // socket can be used without acquiring file lock.
   bool abstract = 2;

+ 5 - 5
transport/internet/kcp/kcp_test.go

@@ -18,7 +18,7 @@ import (
 )
 
 func TestDialAndListen(t *testing.T) {
-	listerner, err := NewListener(context.Background(), net.LocalHostIP, net.Port(0), &internet.MemoryStreamConfig{
+	listener, err := NewListener(context.Background(), net.LocalHostIP, net.Port(0), &internet.MemoryStreamConfig{
 		ProtocolName:     "mkcp",
 		ProtocolSettings: &Config{},
 	}, func(conn internet.Connection) {
@@ -38,9 +38,9 @@ func TestDialAndListen(t *testing.T) {
 		}(conn)
 	})
 	common.Must(err)
-	defer listerner.Close()
+	defer listener.Close()
 
-	port := net.Port(listerner.Addr().(*net.UDPAddr).Port)
+	port := net.Port(listener.Addr().(*net.UDPAddr).Port)
 
 	var errg errgroup.Group
 	for i := 0; i < 10; i++ {
@@ -76,10 +76,10 @@ func TestDialAndListen(t *testing.T) {
 		t.Fatal(err)
 	}
 
-	for i := 0; i < 60 && listerner.ActiveConnections() > 0; i++ {
+	for i := 0; i < 60 && listener.ActiveConnections() > 0; i++ {
 		time.Sleep(500 * time.Millisecond)
 	}
-	if v := listerner.ActiveConnections(); v != 0 {
+	if v := listener.ActiveConnections(); v != 0 {
 		t.Error("active connections: ", v)
 	}
 }