Chore: Run gofmt (#3990)

This commit is contained in:
zonescape 2024-11-09 14:16:11 +03:00 committed by GitHub
parent bc4bf3d38f
commit 83bab5dd90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 272 additions and 273 deletions

View file

@ -22,7 +22,7 @@ import (
// MemoryAccount is an account type converted from Account.
type MemoryAccount struct {
Cipher Cipher
CipherType CipherType
CipherType CipherType
Key []byte
Password string
@ -42,8 +42,8 @@ func (a *MemoryAccount) Equals(another protocol.Account) bool {
func (a *MemoryAccount) ToProto() proto.Message {
return &Account{
CipherType: a.CipherType,
Password: a.Password,
IvCheck: a.replayFilter != nil,
Password: a.Password,
IvCheck: a.replayFilter != nil,
}
}
@ -117,10 +117,10 @@ func (a *Account) AsAccount() (protocol.Account, error) {
return nil, errors.New("failed to get cipher").Base(err)
}
return &MemoryAccount{
Cipher: Cipher,
Cipher: Cipher,
CipherType: a.CipherType,
Key: passwordToCipherKey([]byte(a.Password), Cipher.KeySize()),
Password: a.Password,
Key: passwordToCipherKey([]byte(a.Password), Cipher.KeySize()),
Password: a.Password,
replayFilter: func() antireplay.GeneralizedReplayFilter {
if a.IvCheck {
return antireplay.NewBloomRing()

View file

@ -10,9 +10,9 @@ import (
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/errors"
"github.com/xtls/xray-core/common/crypto"
"github.com/xtls/xray-core/common/drain"
"github.com/xtls/xray-core/common/errors"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/protocol"
)