diff options
| author | huker667 <huker@tuta.io> | 2026-03-25 14:48:48 +0300 |
|---|---|---|
| committer | huker667 <huker@tuta.io> | 2026-03-25 14:48:48 +0300 |
| commit | e6aed353a2b288caa6c6a632a80d5484e4614b2c (patch) | |
| tree | 878f8ed96951e22e8a1d02342c1e721ee13a5f70 /package | |
| parent | 4ff821beed2565e84c9c8d0ac774fa678da1f10f (diff) | |
| download | qulay-e6aed353a2b288caa6c6a632a80d5484e4614b2c.tar.gz qulay-e6aed353a2b288caa6c6a632a80d5484e4614b2c.tar.bz2 qulay-e6aed353a2b288caa6c6a632a80d5484e4614b2c.zip | |
move RandStr to helpers
Diffstat (limited to 'package')
| -rw-r--r-- | package/package.go | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/package/package.go b/package/package.go index 6372688..2afd854 100644 --- a/package/package.go +++ b/package/package.go @@ -3,7 +3,6 @@ package pkg import ( "fmt" "bufio" - "math/rand" "slices" "strings" "errors" @@ -27,16 +26,8 @@ type Package struct { Data []interface{} } -func randStr(n int) string { - b := make([]byte, n) - for i := range b { - b[i] = byte(rand.Intn(26) + 'a') - } - return string(b) -} - func randomTempDir(destDir string) string { - tempDir := "qulay_" + randStr(10) + tempDir := "qulay_" + helpers.RandStr(10) tempDirPath := filepath.Join(destDir, tempDir) os.MkdirAll(tempDirPath, 0755) return tempDirPath |