Chore: Fix some spelling errors (#3976)

This commit is contained in:
zonescape 2024-11-06 17:27:06 +03:00 committed by yuhan6665
parent afc7ec5506
commit 71cfea8aae
10 changed files with 13 additions and 13 deletions

View file

@ -31,8 +31,8 @@ func New(ctx context.Context, config *Config) (*Instance, error) {
} }
log.RegisterHandler(g) log.RegisterHandler(g)
// Start logger instantly on initialization // start logger now,
// Other modules would log during initialization // then other modules will be able to log during initialization
if err := g.startInternal(); err != nil { if err := g.startInternal(); err != nil {
return nil, err return nil, err
} }

View file

@ -52,7 +52,7 @@ func newHTTPClient(ctxv context.Context, handler string, timeout time.Duration)
// MeasureDelay returns the delay time of the request to dest // MeasureDelay returns the delay time of the request to dest
func (s *pingClient) MeasureDelay() (time.Duration, error) { func (s *pingClient) MeasureDelay() (time.Duration, error) {
if s.httpClient == nil { if s.httpClient == nil {
panic("pingClient no initialized") panic("pingClient not initialized")
} }
req, err := http.NewRequest(http.MethodHead, s.destination, nil) req, err := http.NewRequest(http.MethodHead, s.destination, nil)
if err != nil { if err != nil {

View file

@ -13,7 +13,7 @@ import (
"github.com/xtls/xray-core/features/inbound" "github.com/xtls/xray-core/features/inbound"
) )
// Manager is to manage all inbound handlers. // Manager manages all inbound handlers.
type Manager struct { type Manager struct {
access sync.RWMutex access sync.RWMutex
untaggedHandler []inbound.Handler untaggedHandler []inbound.Handler

View file

@ -54,7 +54,7 @@ func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats.Counter)
return uplinkCounter, downlinkCounter return uplinkCounter, downlinkCounter
} }
// Handler is an implements of outbound.Handler. // Handler implements outbound.Handler.
type Handler struct { type Handler struct {
tag string tag string
senderSettings *proxyman.SenderConfig senderSettings *proxyman.SenderConfig

View file

@ -7,7 +7,7 @@ import (
func (u *User) GetTypedAccount() (Account, error) { func (u *User) GetTypedAccount() (Account, error) {
if u.GetAccount() == nil { if u.GetAccount() == nil {
return nil, errors.New("Account missing").AtWarning() return nil, errors.New("Account is missing").AtWarning()
} }
rawAccount, err := u.Account.GetInstance() rawAccount, err := u.Account.GetInstance()

View file

@ -30,7 +30,7 @@ type ConfigLoader func(input interface{}) (*Config, error)
// ConfigBuilder is a builder to build core.Config from filenames and formats // ConfigBuilder is a builder to build core.Config from filenames and formats
type ConfigBuilder func(files []*ConfigSource) (*Config, error) 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) type ConfigsMerger func(files []*ConfigSource) (string, error)
var ( var (

View file

@ -87,7 +87,7 @@ func (r *resolution) resolve(allFeatures []features.Feature) (bool, error) {
return true, err return true, err
} }
// Instance combines all functionalities in Xray. // Instance combines all Xray features.
type Instance struct { type Instance struct {
access sync.Mutex access sync.Mutex
features []features.Feature features []features.Feature
@ -228,7 +228,7 @@ func initInstanceWithConfig(config *Config, server *Instance) (bool, error) {
) )
if server.featureResolutions != nil { 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 { if err := addInboundHandlers(server, config.Inbound); err != nil {

View file

@ -568,7 +568,7 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
return nil, errors.New(`invalid "minClientVer": `, c.MinClientVer) return nil, errors.New(`invalid "minClientVer": `, c.MinClientVer)
} }
if u, err = strconv.ParseUint(s, 10, 8); err != nil { 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 { } else {
config.MinClientVer[i] = byte(u) config.MinClientVer[i] = byte(u)
} }
@ -582,7 +582,7 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
return nil, errors.New(`invalid "maxClientVer": `, c.MaxClientVer) return nil, errors.New(`invalid "maxClientVer": `, c.MaxClientVer)
} }
if u, err = strconv.ParseUint(s, 10, 8); err != nil { 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 { } else {
config.MaxClientVer[i] = byte(u) config.MaxClientVer[i] = byte(u)
} }

View file

@ -17,7 +17,7 @@ Content-Length: 0
// ResponseConfig is the configuration for blackhole responses. // ResponseConfig is the configuration for blackhole responses.
type ResponseConfig interface { type ResponseConfig interface {
// WriteTo writes predefined response to the give buffer. // WriteTo writes a predefined response to the specified buffer.
WriteTo(buf.Writer) int32 WriteTo(buf.Writer) int32
} }

View file

@ -2,7 +2,7 @@ package internet
import "github.com/xtls/xray-core/common/net" 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 { type MemoryStreamConfig struct {
Destination *net.Destination Destination *net.Destination
ProtocolName string ProtocolName string