From 891bbb96aaf0ff409bf67736465f3be04e57f1fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Mon, 27 Feb 2023 14:10:44 +0800 Subject: [PATCH] make lint happy --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 9ab13ce6..89255803 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,9 @@ import ( "fmt" "math/rand" "os" + "runtime" "strconv" + "strings" "time" "github.com/FloatTech/ZeroBot-Plugin/kanban" // 在最前打印 banner @@ -291,7 +293,10 @@ func init() { } func main() { - rand.Seed(time.Now().UnixNano()) // 全局 seed,其他插件无需再 seed + if !strings.Contains(runtime.Version(), "go1.2") { // go1.20之前版本需要全局 seed,其他插件无需再 seed + rand.Seed(time.Now().UnixNano()) //nolint: staticcheck + rand.Int() + } // 帮助 zero.OnFullMatchGroup([]string{"/help", ".help", "菜单"}, zero.OnlyToMe).SetBlock(true). Handle(func(ctx *zero.Ctx) {