From b8d00aa07c8e909c017a87c10cd88e160eaca74f Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 18 Nov 2022 18:43:34 -0500 Subject: [PATCH] wip --- go.mod | 2 +- go.sum | 2 ++ pkg/utils/random/random.go | 24 ------------------------ pkg/utils/random/random_test.go | 10 ---------- 4 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 pkg/utils/random/random.go delete mode 100644 pkg/utils/random/random_test.go diff --git a/go.mod b/go.mod index e098c5a..b51c13e 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( 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/Microsoft/go-winio v0.5.0 // indirect github.com/ambelovsky/go-structs v1.1.0 // indirect diff --git a/go.sum b/go.sum index f5fe5f5..31fe344 100644 --- a/go.sum +++ b/go.sum @@ -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.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.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/go.mod h1:hnZwGUzcOyiufMpVO7l3gu2gAm6Ws4TY4Nlj3kMshXA= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= diff --git a/pkg/utils/random/random.go b/pkg/utils/random/random.go deleted file mode 100644 index 6909cad..0000000 --- a/pkg/utils/random/random.go +++ /dev/null @@ -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) -} diff --git a/pkg/utils/random/random_test.go b/pkg/utils/random/random_test.go deleted file mode 100644 index 47d801d..0000000 --- a/pkg/utils/random/random_test.go +++ /dev/null @@ -1,10 +0,0 @@ -package random - -import ( - "fmt" - "testing" -) - -func TestRandomString(t *testing.T) { - fmt.Println(RandomString(6, true)) -}