1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-29 15:26:29 -04:00

fix some lint errors

This commit is contained in:
Darien Raymond 2018-07-19 13:31:57 +02:00
parent 2858b769dd
commit e3cc12995f
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
3 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,7 @@ var (
) )
func beginWithHTTPMethod(b []byte) error { func beginWithHTTPMethod(b []byte) error {
for _, m := range methods { for _, m := range &methods {
if len(b) >= len(m) && strings.ToLower(string(b[:len(m)])) == m { if len(b) >= len(m) && strings.ToLower(string(b[:len(m)])) == m {
return nil return nil
} }

View File

@ -36,7 +36,7 @@ func (a *Authentication) ApplySecret(b []byte) {
func generateRandomBytes(random []byte) { func generateRandomBytes(random []byte) {
for { for {
common.Must2(rand.Read(random[:])) common.Must2(rand.Read(random))
if random[0] == 0xef { if random[0] == 0xef {
continue continue

View File

@ -36,14 +36,14 @@ func (a *SimpleAuthenticator) Seal(dst, nonce, plain, extra []byte) []byte {
common.Must2(fnvHash.Write(dst[4:])) common.Must2(fnvHash.Write(dst[4:]))
fnvHash.Sum(dst[:0]) fnvHash.Sum(dst[:0])
len := len(dst) dstLen := len(dst)
xtra := 4 - len%4 xtra := 4 - dstLen%4
if xtra != 4 { if xtra != 4 {
dst = append(dst, make([]byte, xtra)...) dst = append(dst, make([]byte, xtra)...)
} }
xorfwd(dst) xorfwd(dst)
if xtra != 4 { if xtra != 4 {
dst = dst[:len] dst = dst[:dstLen]
} }
return dst return dst
} }