Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
AkinoKaede committed Dec 23, 2021
1 parent 79f7516 commit 423d566
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/stats/channel_test.go
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions common/crypto/chacha20_test.go
Expand Up @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion common/protocol/tls/cert/cert.go
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/signal/timer_test.go
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion features/routing/context.go
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion features/stats/stats.go
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions main/formats/formats.go
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions transport/internet/domainsocket/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion transport/internet/domainsocket/config.proto
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions transport/internet/kcp/kcp_test.go
Expand Up @@ -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) {
Expand All @@ -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++ {
Expand Down Expand Up @@ -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)
}
}

0 comments on commit 423d566

Please sign in to comment.