mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-12 07:29:51 +00:00
chore: remove unused code
This commit is contained in:
parent
c846945905
commit
a51f85826c
@ -1,24 +0,0 @@
|
|||||||
package rand
|
|
||||||
|
|
||||||
import (
|
|
||||||
"math/rand"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Deprecated: this will be removed in the future.
|
|
||||||
// 随机生成指定长度字符串
|
|
||||||
func RandStr(n int) string {
|
|
||||||
seed := time.Now().UnixNano()
|
|
||||||
source := rand.NewSource(seed)
|
|
||||||
random := rand.New(source)
|
|
||||||
|
|
||||||
letters := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
|
||||||
|
|
||||||
// 使用循环生成指定长度的字符串
|
|
||||||
result := make([]rune, n)
|
|
||||||
for i := range result {
|
|
||||||
result[i] = letters[random.Intn(len(letters))]
|
|
||||||
}
|
|
||||||
|
|
||||||
return string(result)
|
|
||||||
}
|
|
@ -13,9 +13,3 @@ func BeijingTimeStr() string {
|
|||||||
// 格式化为字符串
|
// 格式化为字符串
|
||||||
return now.Format("2006-01-02 15:04:05")
|
return now.Format("2006-01-02 15:04:05")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetTimeAfter(d time.Duration) string {
|
|
||||||
t := time.Now().UTC()
|
|
||||||
|
|
||||||
return t.Add(d).Format("2006-01-02 15:04:05")
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user