Add api build and clean to makefile (files restructure) (#9)

* no message
* add clean api command
This commit is contained in:
gadotroee
2021-04-28 08:08:58 +03:00
committed by GitHub
parent 1d2462562e
commit 0061f7d14a
18 changed files with 24 additions and 135 deletions

View File

@@ -0,0 +1,22 @@
package utils
import (
"math/rand"
"time"
)
const charset = "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
var seededRand = rand.New(rand.NewSource(time.Now().UnixNano()))
func StringWithCharset(length int, charset string) string {
b := make([]byte, length)
for i := range b {
b[i] = charset[seededRand.Intn(len(charset))]
}
return string(b)
}
func GetRandomString(length int) string {
return StringWithCharset(length, charset)
}