mirror of
1
Fork 0

fix: fix slice init length (#3382)

This commit is contained in:
cui fliter 2024-10-04 01:22:26 +08:00 committed by GitHub
parent 3f7dc10449
commit 23b6d2cc64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -618,7 +618,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
} }
if diff := len(accountsSorted) - len(preserializedKeys); diff > 0 { if diff := len(accountsSorted) - len(preserializedKeys); diff > 0 {
keyStrings := make([]string, diff) keyStrings := make([]string, 0, diff)
for i := 0; i < diff; i++ { for i := 0; i < diff; i++ {
priv, _ := rsa.GenerateKey(rand.Reader, 2048) priv, _ := rsa.GenerateKey(rand.Reader, 2048)
key, _ := x509.MarshalPKCS8PrivateKey(priv) key, _ := x509.MarshalPKCS8PrivateKey(priv)