Skip to content

Commit

Permalink
fix: playground
Browse files Browse the repository at this point in the history
  • Loading branch information
kj455 committed Jan 4, 2025
1 parent 7d71d31 commit ad91353
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions playground/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,8 @@ import (
"golang.org/x/exp/rand"
)

func RandomString(n int) string {
const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
b := make([]byte, n)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
}

func main() {
const (
driverName = "simple"
)
const driverName = "simple"
dataSourceName := RandomString(30)
db, err := sql.Open(driverName, dataSourceName)
if err != nil {
Expand Down Expand Up @@ -78,3 +67,12 @@ func main() {
}
log.Println("Done.")
}

func RandomString(n int) string {
const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
b := make([]byte, n)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
}

0 comments on commit ad91353

Please sign in to comment.