docs: 优化 module 使用示例

This commit is contained in:
Mmx
2023-11-10 10:04:53 +08:00
committed by GitHub
parent 15d9b703e4
commit f33150c5fe

View File

@@ -172,7 +172,7 @@ import (
func main() { func main() {
//具体用法请查看 struct 注释 //具体用法请查看 struct 注释
client:=srun.New(&srun.Conf{ client := srun.New(&srun.Conf{
Https: false, Https: false,
Client: nil, Client: nil,
LoginInfo: srun.LoginInfo{ LoginInfo: srun.LoginInfo{
@@ -191,16 +191,16 @@ func main() {
}, },
}) })
online, ip, e := client.LoginStatus() online, ip, err := client.LoginStatus()
if e!=nil { if err != nil {
panic(e) panic(err)
} }
if !online { if !online {
e=client.DoLogin(ip) err = client.DoLogin(ip)
if e!=nil { if err != nil {
panic(e) panic(err)
} }
} }
} }
``` ```