From 71cfea8aae9802ca0e7e5d35aba2948445dfe34c Mon Sep 17 00:00:00 2001 From: zonescape <44441590+zonescape@users.noreply.github.com> Date: Wed, 6 Nov 2024 17:27:06 +0300 Subject: [PATCH] Chore: Fix some spelling errors (#3976) --- app/log/log.go | 4 ++-- app/observatory/burst/ping.go | 2 +- app/proxyman/inbound/inbound.go | 2 +- app/proxyman/outbound/handler.go | 2 +- common/protocol/user.go | 2 +- core/config.go | 2 +- core/xray.go | 4 ++-- infra/conf/transport_internet.go | 4 ++-- proxy/blackhole/config.go | 2 +- transport/internet/memory_settings.go | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/log/log.go b/app/log/log.go index 90de99e2..da69d3b6 100644 --- a/app/log/log.go +++ b/app/log/log.go @@ -31,8 +31,8 @@ func New(ctx context.Context, config *Config) (*Instance, error) { } log.RegisterHandler(g) - // Start logger instantly on initialization - // Other modules would log during initialization + // start logger now, + // then other modules will be able to log during initialization if err := g.startInternal(); err != nil { return nil, err } diff --git a/app/observatory/burst/ping.go b/app/observatory/burst/ping.go index ccc0af68..de1465b9 100644 --- a/app/observatory/burst/ping.go +++ b/app/observatory/burst/ping.go @@ -52,7 +52,7 @@ func newHTTPClient(ctxv context.Context, handler string, timeout time.Duration) // MeasureDelay returns the delay time of the request to dest func (s *pingClient) MeasureDelay() (time.Duration, error) { if s.httpClient == nil { - panic("pingClient no initialized") + panic("pingClient not initialized") } req, err := http.NewRequest(http.MethodHead, s.destination, nil) if err != nil { diff --git a/app/proxyman/inbound/inbound.go b/app/proxyman/inbound/inbound.go index fc0c16a4..cc6aa9d8 100644 --- a/app/proxyman/inbound/inbound.go +++ b/app/proxyman/inbound/inbound.go @@ -13,7 +13,7 @@ import ( "github.com/xtls/xray-core/features/inbound" ) -// Manager is to manage all inbound handlers. +// Manager manages all inbound handlers. type Manager struct { access sync.RWMutex untaggedHandler []inbound.Handler diff --git a/app/proxyman/outbound/handler.go b/app/proxyman/outbound/handler.go index 47d7d6bf..404ac30e 100644 --- a/app/proxyman/outbound/handler.go +++ b/app/proxyman/outbound/handler.go @@ -54,7 +54,7 @@ func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats.Counter) return uplinkCounter, downlinkCounter } -// Handler is an implements of outbound.Handler. +// Handler implements outbound.Handler. type Handler struct { tag string senderSettings *proxyman.SenderConfig diff --git a/common/protocol/user.go b/common/protocol/user.go index 2986eb19..230c4b6d 100644 --- a/common/protocol/user.go +++ b/common/protocol/user.go @@ -7,7 +7,7 @@ import ( func (u *User) GetTypedAccount() (Account, error) { if u.GetAccount() == nil { - return nil, errors.New("Account missing").AtWarning() + return nil, errors.New("Account is missing").AtWarning() } rawAccount, err := u.Account.GetInstance() diff --git a/core/config.go b/core/config.go index e101c920..4390766d 100644 --- a/core/config.go +++ b/core/config.go @@ -30,7 +30,7 @@ type ConfigLoader func(input interface{}) (*Config, error) // ConfigBuilder is a builder to build core.Config from filenames and formats type ConfigBuilder func(files []*ConfigSource) (*Config, error) -// ConfigsMerger merge multiple json configs into on config +// ConfigsMerger merges multiple json configs into a single one type ConfigsMerger func(files []*ConfigSource) (string, error) var ( diff --git a/core/xray.go b/core/xray.go index 09d35d9f..0e1f0830 100644 --- a/core/xray.go +++ b/core/xray.go @@ -87,7 +87,7 @@ func (r *resolution) resolve(allFeatures []features.Feature) (bool, error) { return true, err } -// Instance combines all functionalities in Xray. +// Instance combines all Xray features. type Instance struct { access sync.Mutex features []features.Feature @@ -228,7 +228,7 @@ func initInstanceWithConfig(config *Config, server *Instance) (bool, error) { ) if server.featureResolutions != nil { - return true, errors.New("not all dependency are resolved.") + return true, errors.New("not all dependencies are resolved.") } if err := addInboundHandlers(server, config.Inbound); err != nil { diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index c81123a3..ed1ea072 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -568,7 +568,7 @@ func (c *REALITYConfig) Build() (proto.Message, error) { return nil, errors.New(`invalid "minClientVer": `, c.MinClientVer) } if u, err = strconv.ParseUint(s, 10, 8); err != nil { - return nil, errors.New(`"minClientVer[`, i, `]" should be lesser than 256`) + return nil, errors.New(`"minClientVer[`, i, `]" should be less than 256`) } else { config.MinClientVer[i] = byte(u) } @@ -582,7 +582,7 @@ func (c *REALITYConfig) Build() (proto.Message, error) { return nil, errors.New(`invalid "maxClientVer": `, c.MaxClientVer) } if u, err = strconv.ParseUint(s, 10, 8); err != nil { - return nil, errors.New(`"maxClientVer[`, i, `]" should be lesser than 256`) + return nil, errors.New(`"maxClientVer[`, i, `]" should be less than 256`) } else { config.MaxClientVer[i] = byte(u) } diff --git a/proxy/blackhole/config.go b/proxy/blackhole/config.go index b0f8e60c..e4a16684 100644 --- a/proxy/blackhole/config.go +++ b/proxy/blackhole/config.go @@ -17,7 +17,7 @@ Content-Length: 0 // ResponseConfig is the configuration for blackhole responses. type ResponseConfig interface { - // WriteTo writes predefined response to the give buffer. + // WriteTo writes a predefined response to the specified buffer. WriteTo(buf.Writer) int32 } diff --git a/transport/internet/memory_settings.go b/transport/internet/memory_settings.go index a46fc297..f1331353 100644 --- a/transport/internet/memory_settings.go +++ b/transport/internet/memory_settings.go @@ -2,7 +2,7 @@ package internet import "github.com/xtls/xray-core/common/net" -// MemoryStreamConfig is a parsed form of StreamConfig. This is used to reduce the number of Protobuf parsings. +// MemoryStreamConfig is a parsed form of StreamConfig. It is used to reduce the number of Protobuf parses. type MemoryStreamConfig struct { Destination *net.Destination ProtocolName string