docs: 优化 module 使用示例
This commit is contained in:
16
README.md
16
README.md
@@ -172,7 +172,7 @@ import (
|
||||
|
||||
func main() {
|
||||
//具体用法请查看 struct 注释
|
||||
client:=srun.New(&srun.Conf{
|
||||
client := srun.New(&srun.Conf{
|
||||
Https: false,
|
||||
Client: nil,
|
||||
LoginInfo: srun.LoginInfo{
|
||||
@@ -191,16 +191,16 @@ func main() {
|
||||
},
|
||||
})
|
||||
|
||||
online, ip, e := client.LoginStatus()
|
||||
if e!=nil {
|
||||
panic(e)
|
||||
online, ip, err := client.LoginStatus()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if !online {
|
||||
e=client.DoLogin(ip)
|
||||
if e!=nil {
|
||||
panic(e)
|
||||
err = client.DoLogin(ip)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user