Chore: Fix some spelling errors (#3976)

pull/3977/head
zonescape 3 weeks ago committed by yuhan6665
parent afc7ec5506
commit 71cfea8aae

@ -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
}

@ -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 {

@ -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

@ -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

@ -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()

@ -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 (

@ -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 {

@ -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)
}

@ -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
}

@ -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

Loading…
Cancel
Save