0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-12 11:29:36 +03:00

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
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()