Remove randStr private utility function

This commit is contained in:
Brian Picciano 2024-09-09 21:38:10 +02:00
parent 8c3e6a2845
commit 6d99fb5368
2 changed files with 2 additions and 16 deletions

View File

@ -1,14 +0,0 @@
package network
import (
"crypto/rand"
"encoding/hex"
)
func randStr(l int) string {
b := make([]byte, l)
if _, err := rand.Read(b); err != nil {
panic(err)
}
return hex.EncodeToString(b)
}

View File

@ -192,7 +192,7 @@ func instatiateNetwork(
stateDir: stateDir, stateDir: stateDir,
runtimeDir: runtimeDir, runtimeDir: runtimeDir,
opts: opts.withDefaults(), opts: opts.withDefaults(),
garageAdminToken: randStr(32), garageAdminToken: toolkit.RandStr(32),
shutdownCh: make(chan struct{}), shutdownCh: make(chan struct{}),
} }
} }
@ -346,7 +346,7 @@ func Create(
return nil, fmt.Errorf("creating nebula CA cert: %w", err) return nil, fmt.Errorf("creating nebula CA cert: %w", err)
} }
garageRPCSecret := randStr(32) garageRPCSecret := toolkit.RandStr(32)
n := instatiateNetwork( n := instatiateNetwork(
logger, logger,