Reformat code

This commit is contained in:
世界 2022-05-18 15:29:01 +08:00
parent 778992eeb9
commit f046feb9ca
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
153 changed files with 82 additions and 229 deletions

View file

@ -8,14 +8,13 @@ import (
"crypto/sha1"
"io"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/crypto/hkdf"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/antireplay"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/crypto"
"github.com/xtls/xray-core/common/protocol"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/crypto/hkdf"
)
// MemoryAccount is an account type converted from Account.
@ -26,9 +25,7 @@ type MemoryAccount struct {
replayFilter antireplay.GeneralizedReplayFilter
}
var (
ErrIVNotUnique = newError("IV is not unique")
)
var ErrIVNotUnique = newError("IV is not unique")
// Equals implements protocol.Account.Equals().
func (a *MemoryAccount) Equals(another protocol.Account) bool {

View file

@ -5,7 +5,6 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/proxy/shadowsocks"

View file

@ -172,7 +172,6 @@ func ReadTCPResponse(user *protocol.MemoryUser, reader io.Reader) (buf.Reader, e
behaviorSeed := crc32.ChecksumIEEE(hashkdf.Sum(nil))
drainer, err := drain.NewBehaviorSeedLimitedDrainer(int64(behaviorSeed), 16+38, 3266, 64)
if err != nil {
return nil, newError("failed to initialize drainer").Base(err)
}

View file

@ -4,7 +4,6 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/net"

View file

@ -21,9 +21,7 @@ type Validator struct {
behaviorFused bool
}
var (
ErrNotFound = newError("Not Found")
)
var ErrNotFound = newError("Not Found")
// Add a Shadowsocks user.
func (v *Validator) Add(u *protocol.MemoryUser) error {