mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-14 01:29:17 -04:00
Refine code according to golangci-lint results
This commit is contained in:
@@ -136,7 +136,6 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter
|
||||
}
|
||||
|
||||
if request.Command == protocol.RequestCommandUDP {
|
||||
|
||||
writer := &buf.SequentialWriter{Writer: &UDPWriter{
|
||||
Writer: conn,
|
||||
Request: request,
|
||||
|
||||
@@ -6,14 +6,13 @@ import (
|
||||
"crypto/hmac"
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"hash"
|
||||
"hash/crc32"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"v2ray.com/core/common/dice"
|
||||
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/buf"
|
||||
"v2ray.com/core/common/dice"
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/protocol"
|
||||
)
|
||||
@@ -35,7 +34,7 @@ var addrParser = protocol.NewAddressParser(
|
||||
func ReadTCPSession(user *protocol.MemoryUser, reader io.Reader) (*protocol.RequestHeader, buf.Reader, error) {
|
||||
account := user.Account.(*MemoryAccount)
|
||||
|
||||
hashkdf := hmac.New(func() hash.Hash { return sha256.New() }, []byte("SSBSKDF"))
|
||||
hashkdf := hmac.New(sha256.New, []byte("SSBSKDF"))
|
||||
hashkdf.Write(account.Key)
|
||||
|
||||
behaviorSeed := crc32.ChecksumIEEE(hashkdf.Sum(nil))
|
||||
|
||||
@@ -133,7 +133,6 @@ func TestTCPRequest(t *testing.T) {
|
||||
for _, test := range cases {
|
||||
runTest(test.request, test.payload)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestUDPReaderWriter(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user