pkg/pools: Use pool for strings.Builder everywhere
This commit is contained in:
parent
8af2213d5a
commit
a63bb2f669
7 changed files with 44 additions and 25 deletions
|
|
@ -4,7 +4,8 @@ package password
|
|||
import (
|
||||
"crypto/rand"
|
||||
"math/big"
|
||||
"strings"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/pools"
|
||||
)
|
||||
|
||||
// NOTE(twiesing): A bunch of scripts cannot properly handle the extra characters in the password.
|
||||
|
|
@ -23,7 +24,8 @@ func Password(length int) (string, error) {
|
|||
}
|
||||
|
||||
// create a buffer to write the string to!
|
||||
var password strings.Builder
|
||||
password := pools.GetBuilder()
|
||||
defer pools.ReleaseBuilder(password)
|
||||
password.Grow(length)
|
||||
|
||||
for i := 0; i < length; i++ {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue