From a58063e7ac9f160ffbe90e55b5fc86a2e4cf6559 Mon Sep 17 00:00:00 2001 From: wuxiangzhou2010 Date: Mon, 2 Apr 2018 15:17:36 +0800 Subject: [PATCH 1/3] fix typo, first sound of user is not a vowel, but the consonant /j/ --- app/proxyman/command/command.go | 4 ++-- common/protocol/account.go | 2 +- common/protocol/context.go | 4 ++-- proxy/proxy.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 app/proxyman/command/command.go mode change 100644 => 100755 common/protocol/account.go mode change 100644 => 100755 common/protocol/context.go mode change 100644 => 100755 proxy/proxy.go diff --git a/app/proxyman/command/command.go b/app/proxyman/command/command.go old mode 100644 new mode 100755 index ca0b662c..e80f3d2c --- a/app/proxyman/command/command.go +++ b/app/proxyman/command/command.go @@ -37,7 +37,7 @@ func (op *AddUserOperation) ApplyInbound(ctx context.Context, handler core.Inbou } um, ok := p.(proxy.UserManager) if !ok { - return newError("proxy is not an UserManager") + return newError("proxy is not a UserManager") } return um.AddUser(ctx, op.User) } @@ -50,7 +50,7 @@ func (op *RemoveUserOperation) ApplyInbound(ctx context.Context, handler core.In } um, ok := p.(proxy.UserManager) if !ok { - return newError("proxy is not an UserManager") + return newError("proxy is not a UserManager") } return um.RemoveUser(ctx, op.Email) } diff --git a/common/protocol/account.go b/common/protocol/account.go old mode 100644 new mode 100755 index 1c6a1eea..7793974a --- a/common/protocol/account.go +++ b/common/protocol/account.go @@ -1,6 +1,6 @@ package protocol -// Account is an user identity used for authentication. +// Account is a user identity used for authentication. type Account interface { Equals(Account) bool } diff --git a/common/protocol/context.go b/common/protocol/context.go old mode 100644 new mode 100755 index 6a2d2409..17437719 --- a/common/protocol/context.go +++ b/common/protocol/context.go @@ -10,12 +10,12 @@ const ( userKey key = iota ) -// ContextWithUser returns a context combined with an User. +// ContextWithUser returns a context combined with a User. func ContextWithUser(ctx context.Context, user *User) context.Context { return context.WithValue(ctx, userKey, user) } -// UserFromContext extracts an User from the given context, if any. +// UserFromContext extracts a User from the given context, if any. func UserFromContext(ctx context.Context) *User { v := ctx.Value(userKey) if v == nil { diff --git a/proxy/proxy.go b/proxy/proxy.go old mode 100644 new mode 100755 index 0278d118..a0d0ac42 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -41,7 +41,7 @@ type UserManager interface { // AddUser adds a new user. AddUser(context.Context, *protocol.User) error - // RemoveUser removes an user by email. + // RemoveUser removes a user by email. RemoveUser(context.Context, string) error } From 5a08411ee20b6669cb680abc3af6abd13f075049 Mon Sep 17 00:00:00 2001 From: wuxiangzhou2010 Date: Mon, 2 Apr 2018 15:52:16 +0800 Subject: [PATCH 2/3] fix typo --- common/crypto/chunk.go | 4 ++-- common/protocol/id.go | 2 +- common/serial/bytes.go | 4 ++-- common/serial/numbers.go | 2 +- common/signal/done.go | 2 +- common/signal/notifier.go | 2 +- common/uuid/uuid.go | 6 +++--- config.go | 2 +- proxy/vmess/account.pb.go | 2 +- proxy/vmess/account.proto | 2 +- transport/internet/kcp/segment.go | 2 +- v2ray.go | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) mode change 100644 => 100755 common/crypto/chunk.go mode change 100644 => 100755 common/protocol/id.go mode change 100644 => 100755 common/serial/bytes.go mode change 100644 => 100755 common/serial/numbers.go mode change 100644 => 100755 common/signal/done.go mode change 100644 => 100755 common/signal/notifier.go mode change 100644 => 100755 common/uuid/uuid.go mode change 100644 => 100755 config.go mode change 100644 => 100755 proxy/vmess/account.pb.go mode change 100644 => 100755 proxy/vmess/account.proto mode change 100644 => 100755 transport/internet/kcp/segment.go diff --git a/common/crypto/chunk.go b/common/crypto/chunk.go old mode 100644 new mode 100755 index e5411998..decfdffc --- a/common/crypto/chunk.go +++ b/common/crypto/chunk.go @@ -8,13 +8,13 @@ import ( "v2ray.com/core/common/serial" ) -// ChunkSizeDecoder is an utility class to decode size value from bytes. +// ChunkSizeDecoder is a utility class to decode size value from bytes. type ChunkSizeDecoder interface { SizeBytes() int Decode([]byte) (uint16, error) } -// ChunkSizeEncoder is an utility class to encode size value into bytes. +// ChunkSizeEncoder is a utility class to encode size value into bytes. type ChunkSizeEncoder interface { SizeBytes() int Encode(uint16, []byte) []byte diff --git a/common/protocol/id.go b/common/protocol/id.go old mode 100644 new mode 100755 index e6b0176e..6deb0cce --- a/common/protocol/id.go +++ b/common/protocol/id.go @@ -19,7 +19,7 @@ func DefaultIDHash(key []byte) hash.Hash { return hmac.New(md5.New, key) } -// The ID of en entity, in the form of an UUID. +// The ID of en entity, in the form of a UUID. type ID struct { uuid uuid.UUID cmdKey [IDBytesLen]byte diff --git a/common/serial/bytes.go b/common/serial/bytes.go old mode 100644 new mode 100755 index 14c7676c..69475b19 --- a/common/serial/bytes.go +++ b/common/serial/bytes.go @@ -7,12 +7,12 @@ func ByteToHexString(value byte) string { return hex.EncodeToString([]byte{value}) } -// BytesToUint16 deserializes a byte array to an uint16 in big endian order. The byte array must have at least 2 elements. +// BytesToUint16 deserializes a byte array to a uint16 in big endian order. The byte array must have at least 2 elements. func BytesToUint16(value []byte) uint16 { return uint16(value[0])<<8 | uint16(value[1]) } -// BytesToUint32 deserializes a byte array to an uint32 in big endian order. The byte array must have at least 4 elements. +// BytesToUint32 deserializes a byte array to a uint32 in big endian order. The byte array must have at least 4 elements. func BytesToUint32(value []byte) uint32 { return uint32(value[0])<<24 | uint32(value[1])<<16 | diff --git a/common/serial/numbers.go b/common/serial/numbers.go old mode 100644 new mode 100755 index 556fcb34..3b15c38f --- a/common/serial/numbers.go +++ b/common/serial/numbers.go @@ -3,7 +3,7 @@ package serial import "strconv" import "io" -// Uint16ToBytes serializes an uint16 into bytes in big endian order. +// Uint16ToBytes serializes a uint16 into bytes in big endian order. func Uint16ToBytes(value uint16, b []byte) []byte { return append(b, byte(value>>8), byte(value)) } diff --git a/common/signal/done.go b/common/signal/done.go old mode 100644 new mode 100755 index bedf50ab..351f8c63 --- a/common/signal/done.go +++ b/common/signal/done.go @@ -4,7 +4,7 @@ import ( "sync" ) -// Done is an utility for notifications of something being done. +// Done is a utility for notifications of something being done. type Done struct { access sync.Mutex c chan struct{} diff --git a/common/signal/notifier.go b/common/signal/notifier.go old mode 100644 new mode 100755 index 0a036278..19836e54 --- a/common/signal/notifier.go +++ b/common/signal/notifier.go @@ -1,6 +1,6 @@ package signal -// Notifier is an utility for notifying changes. The change producer may notify changes multiple time, and the consumer may get notified asynchronously. +// Notifier is a utility for notifying changes. The change producer may notify changes multiple time, and the consumer may get notified asynchronously. type Notifier struct { c chan struct{} } diff --git a/common/uuid/uuid.go b/common/uuid/uuid.go old mode 100644 new mode 100755 index 0e0ca386..06b219a0 --- a/common/uuid/uuid.go +++ b/common/uuid/uuid.go @@ -61,14 +61,14 @@ func (u *UUID) Next() UUID { } } -// New creates an UUID with random value. +// New creates a UUID with random value. func New() UUID { var uuid UUID common.Must2(rand.Read(uuid.Bytes())) return uuid } -// ParseBytes converts an UUID in byte form to object. +// ParseBytes converts a UUID in byte form to object. func ParseBytes(b []byte) (UUID, error) { var uuid UUID if len(b) != 16 { @@ -78,7 +78,7 @@ func ParseBytes(b []byte) (UUID, error) { return uuid, nil } -// ParseString converts an UUID in string form to object. +// ParseString converts a UUID in string form to object. func ParseString(str string) (UUID, error) { var uuid UUID diff --git a/config.go b/config.go old mode 100644 new mode 100755 index 345af0c5..d03f0673 --- a/config.go +++ b/config.go @@ -16,7 +16,7 @@ type ConfigFormat struct { Loader ConfigLoader } -// ConfigLoader is an utility to load V2Ray config from external source. +// ConfigLoader is a utility to load V2Ray config from external source. type ConfigLoader func(input io.Reader) (*Config, error) var ( diff --git a/proxy/vmess/account.pb.go b/proxy/vmess/account.pb.go old mode 100644 new mode 100755 index d78ba296..05607fa0 --- a/proxy/vmess/account.pb.go +++ b/proxy/vmess/account.pb.go @@ -17,7 +17,7 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Account struct { - // ID of the account, in the form of an UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57". + // ID of the account, in the form of a UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57". Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` // Number of alternative IDs. Client and server must share the same number. AlterId uint32 `protobuf:"varint,2,opt,name=alter_id,json=alterId" json:"alter_id,omitempty"` diff --git a/proxy/vmess/account.proto b/proxy/vmess/account.proto old mode 100644 new mode 100755 index c69317d9..34374914 --- a/proxy/vmess/account.proto +++ b/proxy/vmess/account.proto @@ -9,7 +9,7 @@ option java_multiple_files = true; import "v2ray.com/core/common/protocol/headers.proto"; message Account { - // ID of the account, in the form of an UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57". + // ID of the account, in the form of a UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57". string id = 1; // Number of alternative IDs. Client and server must share the same number. uint32 alter_id = 2; diff --git a/transport/internet/kcp/segment.go b/transport/internet/kcp/segment.go old mode 100644 new mode 100755 index 9af1629d..25b47590 --- a/transport/internet/kcp/segment.go +++ b/transport/internet/kcp/segment.go @@ -9,7 +9,7 @@ import ( type Command byte const ( - // CommandACK indicates a AckSegment. + // CommandACK indicates an AckSegment. CommandACK Command = 0 // CommandData indicates a DataSegment. CommandData Command = 1 diff --git a/v2ray.go b/v2ray.go index 8bd4dc71..28af89a6 100755 --- a/v2ray.go +++ b/v2ray.go @@ -94,7 +94,7 @@ func (s *Instance) CreateObject(config interface{}) (interface{}, error) { return common.CreateObject(ctx, config) } -// ID returns an unique ID for this V2Ray instance. +// ID returns a unique ID for this V2Ray instance. func (s *Instance) ID() uuid.UUID { return s.id } From f0862df9a76f7e4c70889b8ca5bab92101bba24c Mon Sep 17 00:00:00 2001 From: wuxiangzhou2010 Date: Mon, 2 Apr 2018 16:12:35 +0800 Subject: [PATCH 3/3] fix typo --- core.go | 2 +- proxy/http/server.go | 2 +- transport/internet/websocket/ws.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 core.go mode change 100644 => 100755 proxy/http/server.go mode change 100644 => 100755 transport/internet/websocket/ws.go diff --git a/core.go b/core.go old mode 100644 new mode 100755 index bcc3fc68..5ad599ba --- a/core.go +++ b/core.go @@ -19,7 +19,7 @@ var ( version = "3.16" build = "Custom" codename = "die Commanderin" - intro = "An unified platform for anti-censorship." + intro = "A unified platform for anti-censorship." ) // Version returns V2Ray's version as a string, in the form of "x.y.z" where x, y and z are numbers. diff --git a/proxy/http/server.go b/proxy/http/server.go old mode 100644 new mode 100755 index ec30bd11..ffc7a1bc --- a/proxy/http/server.go +++ b/proxy/http/server.go @@ -21,7 +21,7 @@ import ( "v2ray.com/core/transport/internet" ) -// Server is a HTTP proxy server. +// Server is an HTTP proxy server. type Server struct { config *ServerConfig v *core.Instance diff --git a/transport/internet/websocket/ws.go b/transport/internet/websocket/ws.go old mode 100644 new mode 100755 index 7e5f1c7a..e9863b03 --- a/transport/internet/websocket/ws.go +++ b/transport/internet/websocket/ws.go @@ -1,6 +1,6 @@ /*Package websocket implements Websocket transport -Websocket transport implements a HTTP(S) compliable, surveillance proof transport method with plausible deniability. +Websocket transport implements an HTTP(S) compliable, surveillance proof transport method with plausible deniability. */ package websocket