Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit ca84dd0

Browse files
committed
Use alpha string only
1 parent 447a23f commit ca84dd0

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

do.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
package main
22

33
import (
4-
"crypto/rand"
5-
"encoding/base64"
64
"fmt"
75

86
"github.com/digitalocean/godo"
7+
"github.com/jmcvetta/randutil"
98
)
109

1110
func doRegions(client *godo.Client) ([]string, error) {
@@ -24,9 +23,8 @@ func newDropLetMultiCreateRequest(prefix, region, keyID string, count int) *godo
2423

2524
names := []string{}
2625
for i := 0; i < count; i++ {
27-
b := make([]byte, 6)
28-
rand.Read(b)
29-
names = append(names, fmt.Sprintf("%s-%s", prefix, base64.StdEncoding.EncodeToString(b)))
26+
name, _ := randutil.AlphaString(8)
27+
names = append(names, fmt.Sprintf("%s-%s", prefix, name))
3028
}
3129

3230
return &godo.DropletMultiCreateRequest{

0 commit comments

Comments
 (0)