chore: remove unused code

This commit is contained in:
Fu Diwei 2024-12-20 23:00:05 +08:00
parent c846945905
commit a51f85826c
2 changed files with 0 additions and 30 deletions

View File

@ -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)
}

View File

@ -13,9 +13,3 @@ func BeijingTimeStr() string {
// 格式化为字符串
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")
}