mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
make golangci-lint happy
This commit is contained in:
parent
4d064e145f
commit
84e061f321
@ -29,7 +29,7 @@ func readLine() (str string) {
|
||||
return
|
||||
}
|
||||
|
||||
func readLineTimeout(t time.Duration, de string) (str string) {
|
||||
func readLineTimeout(t time.Duration) {
|
||||
r := make(chan string)
|
||||
go func() {
|
||||
select {
|
||||
@ -37,12 +37,10 @@ func readLineTimeout(t time.Duration, de string) (str string) {
|
||||
case <-time.After(t):
|
||||
}
|
||||
}()
|
||||
str = de
|
||||
select {
|
||||
case str = <-r:
|
||||
case <-r:
|
||||
case <-time.After(t):
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func readIfTTY(de string) (str string) {
|
||||
@ -210,7 +208,7 @@ func loginResponseProcessor(res *client.LoginResponse) error {
|
||||
case client.UnsafeDeviceError:
|
||||
log.Warnf("账号已开启设备锁,请前往 -> %v <- 验证后重启Bot.", res.VerifyUrl)
|
||||
log.Infof("按 Enter 或等待 5s 后继续....")
|
||||
readLineTimeout(time.Second*5, "")
|
||||
readLineTimeout(time.Second * 5)
|
||||
os.Exit(0)
|
||||
case client.OtherLoginError, client.UnknownLoginError, client.TooManySMSRequestError:
|
||||
msg := res.ErrorMessage
|
||||
@ -221,7 +219,7 @@ func loginResponseProcessor(res *client.LoginResponse) error {
|
||||
}
|
||||
log.Warnf("登录失败: %v", msg)
|
||||
log.Infof("按 Enter 或等待 5s 后继续....")
|
||||
readLineTimeout(time.Second*5, "")
|
||||
readLineTimeout(time.Second * 5)
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
@ -14,12 +14,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/segmentio/asm/base64"
|
||||
|
||||
"github.com/Mrs4s/MiraiGo/binary"
|
||||
"github.com/Mrs4s/MiraiGo/client"
|
||||
"github.com/Mrs4s/MiraiGo/message"
|
||||
"github.com/Mrs4s/MiraiGo/utils"
|
||||
"github.com/segmentio/asm/base64"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/tidwall/gjson"
|
||||
|
||||
|
@ -20,13 +20,12 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/segmentio/asm/base64"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/image/webp"
|
||||
|
||||
"github.com/Mrs4s/go-cqhttp/db"
|
||||
"github.com/Mrs4s/go-cqhttp/global"
|
||||
"github.com/Mrs4s/go-cqhttp/internal/base"
|
||||
"github.com/Mrs4s/go-cqhttp/internal/mime"
|
||||
|
||||
"golang.org/x/image/webp"
|
||||
)
|
||||
|
||||
// CQBot CQBot结构体,存储Bot实例相关配置
|
||||
|
@ -4,10 +4,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/Mrs4s/MiraiGo/topic"
|
||||
|
||||
"github.com/Mrs4s/MiraiGo/client"
|
||||
"github.com/Mrs4s/MiraiGo/message"
|
||||
"github.com/Mrs4s/MiraiGo/topic"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Mrs4s/go-cqhttp/global"
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/Mrs4s/MiraiGo/binary"
|
||||
|
||||
"github.com/Mrs4s/go-cqhttp/global"
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user