This commit is contained in:
Tiger Wang 2022-11-18 18:43:34 -05:00
parent 0c6c763a75
commit b8d00aa07c
4 changed files with 3 additions and 35 deletions

2
go.mod
View File

@ -4,7 +4,7 @@ go 1.16
require ( require (
github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d
github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221116011801-d8017d2ff420 github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221118234001-876079b9590f
github.com/IceWhaleTech/CasaOS-Gateway v0.3.6 github.com/IceWhaleTech/CasaOS-Gateway v0.3.6
github.com/Microsoft/go-winio v0.5.0 // indirect github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/ambelovsky/go-structs v1.1.0 // indirect github.com/ambelovsky/go-structs v1.1.0 // indirect

2
go.sum
View File

@ -96,6 +96,8 @@ github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221116004806-159ec400f70f h1:zR
github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221116004806-159ec400f70f/go.mod h1:2MiivEMzvh41codhEKUcn46WK3Ffesop/04qa9jsvQk= github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221116004806-159ec400f70f/go.mod h1:2MiivEMzvh41codhEKUcn46WK3Ffesop/04qa9jsvQk=
github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221116011801-d8017d2ff420 h1:4M+5/doXry6Y8iKS3Cl/SLJIZPrRH1cmwQfMrj57T3I= github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221116011801-d8017d2ff420 h1:4M+5/doXry6Y8iKS3Cl/SLJIZPrRH1cmwQfMrj57T3I=
github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221116011801-d8017d2ff420/go.mod h1:2MiivEMzvh41codhEKUcn46WK3Ffesop/04qa9jsvQk= github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221116011801-d8017d2ff420/go.mod h1:2MiivEMzvh41codhEKUcn46WK3Ffesop/04qa9jsvQk=
github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221118234001-876079b9590f h1:ap74AFvaqNXGYcG6ZHA9VUp7sVCEFLQdr8ocufcRZB0=
github.com/IceWhaleTech/CasaOS-Common v0.3.9-0.20221118234001-876079b9590f/go.mod h1:2MiivEMzvh41codhEKUcn46WK3Ffesop/04qa9jsvQk=
github.com/IceWhaleTech/CasaOS-Gateway v0.3.6 h1:2tQQo85+jzbbjqIsKKn77QlAA73bc7vZsVCFvWnK4mg= github.com/IceWhaleTech/CasaOS-Gateway v0.3.6 h1:2tQQo85+jzbbjqIsKKn77QlAA73bc7vZsVCFvWnK4mg=
github.com/IceWhaleTech/CasaOS-Gateway v0.3.6/go.mod h1:hnZwGUzcOyiufMpVO7l3gu2gAm6Ws4TY4Nlj3kMshXA= github.com/IceWhaleTech/CasaOS-Gateway v0.3.6/go.mod h1:hnZwGUzcOyiufMpVO7l3gu2gAm6Ws4TY4Nlj3kMshXA=
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=

View File

@ -1,24 +0,0 @@
package random
import (
"math/rand"
"time"
)
func RandomString(n int, onlyLetter bool) string {
var letters []rune
if onlyLetter {
letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
} else {
letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
}
b := make([]rune, n)
rand.Seed(time.Now().UnixNano())
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
}

View File

@ -1,10 +0,0 @@
package random
import (
"fmt"
"testing"
)
func TestRandomString(t *testing.T) {
fmt.Println(RandomString(6, true))
}