From 790f908f0b1eba45c00ace4b5caa76bac060e8ad Mon Sep 17 00:00:00 2001 From: curlwget Date: Thu, 22 Aug 2024 17:32:38 +0800 Subject: [PATCH] chore: fix some comment typos (#3716) Signed-off-by: curlwget --- app/dns/nameserver.go | 2 +- app/stats/channel_test.go | 2 +- common/mux/client.go | 2 +- main/commands/base/execute.go | 2 +- proxy/proxy.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/dns/nameserver.go b/app/dns/nameserver.go index c7ff8a84..8dfa9dc2 100644 --- a/app/dns/nameserver.go +++ b/app/dns/nameserver.go @@ -90,7 +90,7 @@ func NewClient( ns.PrioritizedDomain = append(ns.PrioritizedDomain, localTLDsAndDotlessDomains...) ns.OriginalRules = append(ns.OriginalRules, localTLDsAndDotlessDomainsRule) // The following lines is a solution to avoid core panics(rule index out of range) when setting `localhost` DNS client in config. - // Because the `localhost` DNS client will apend len(localTLDsAndDotlessDomains) rules into matcherInfos to match `geosite:private` default rule. + // Because the `localhost` DNS client will append len(localTLDsAndDotlessDomains) rules into matcherInfos to match `geosite:private` default rule. // But `matcherInfos` has no enough length to add rules, which leads to core panics (rule index out of range). // To avoid this, the length of `matcherInfos` must be equal to the expected, so manually append it with Golang default zero value first for later modification. // Related issues: diff --git a/app/stats/channel_test.go b/app/stats/channel_test.go index ccae8269..f35b95c6 100644 --- a/app/stats/channel_test.go +++ b/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 diff --git a/common/mux/client.go b/common/mux/client.go index 1cbc530a..df74ef17 100644 --- a/common/mux/client.go +++ b/common/mux/client.go @@ -22,7 +22,7 @@ import ( ) type ClientManager struct { - Enabled bool // wheather mux is enabled from user config + Enabled bool // whether mux is enabled from user config Picker WorkerPicker } diff --git a/main/commands/base/execute.go b/main/commands/base/execute.go index 2d18371e..8e23dabf 100644 --- a/main/commands/base/execute.go +++ b/main/commands/base/execute.go @@ -12,7 +12,7 @@ import ( // Use of this source code is governed by a BSD-style // copied from "github.com/golang/go/main.go" -// Execute excute the commands +// Execute execute the commands func Execute() { flag.Parse() args := flag.Args() diff --git a/proxy/proxy.go b/proxy/proxy.go index 926bf164..b507cc39 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -319,7 +319,7 @@ func XtlsPadding(b *buf.Buffer, command byte, userUUID *[]byte, longPadding bool // XtlsUnpadding remove padding and parse command func XtlsUnpadding(b *buf.Buffer, s *TrafficState, ctx context.Context) *buf.Buffer { - if s.RemainingCommand == -1 && s.RemainingContent == -1 && s.RemainingPadding == -1 { // inital state + if s.RemainingCommand == -1 && s.RemainingContent == -1 && s.RemainingPadding == -1 { // initial state if b.Len() >= 21 && bytes.Equal(s.UserUUID, b.BytesTo(16)) { b.Advance(16) s.RemainingCommand = 5