mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-03-01 18:40:26 +00:00
chore(lint): 改进代码样式 (#1143)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e292b69ee5
commit
6c6699a5d6
@@ -2,9 +2,10 @@ package minecraftobserver
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/RomiChan/syncx"
|
||||
"github.com/Tnze/go-mc/bot"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -49,12 +50,12 @@ func getMinecraftServerStatus(addr string) (*serverPingAndListResp, error) {
|
||||
var s serverPingAndListResp
|
||||
resp, delay, err := bot.PingAndListTimeout(addr, time.Second*5)
|
||||
if err != nil {
|
||||
//logrus.Errorln(logPrefix+"PingAndList error: ", err)
|
||||
// logrus.Errorln(logPrefix+"PingAndList error: ", err)
|
||||
return nil, err
|
||||
}
|
||||
err = json.Unmarshal(resp, &s)
|
||||
if err != nil {
|
||||
//logrus.Errorln(logPrefix+"Parse json response fail: ", err)
|
||||
// logrus.Errorln(logPrefix+"Parse json response fail: ", err)
|
||||
return nil, err
|
||||
}
|
||||
s.Delay = delay
|
||||
|
||||
Reference in New Issue
Block a user