mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 01:08:33 +00:00
Reformat code
This commit is contained in:
parent
778992eeb9
commit
f046feb9ca
153 changed files with 82 additions and 229 deletions
|
@ -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 {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue