token_response nil issue

panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
remoteMonitor/thirdpart.get_token({0x2b03ab?, 0x8?}, {0x2b2511?, 0x3?})
	/root/remoteMonitor/thirdpart/WeChat.go:53 +0x1c8
remoteMonitor/thirdpart.SendWechat({0x40000d0000, 0x91})
	/root/remoteMonitor/thirdpart/WeChat.go:101 +0x5c
main.main()
	/root/remoteMonitor/main.go:25 +0x19c
master
dustoair 3 years ago
parent 185d662d8c
commit 271bd9083d

@ -15,9 +15,23 @@ rm -rf /usr/bin/rtm
mv rtm /usr/bin/
rtm
```
## build amd64 oracle
```bash
cd /root
rm -rf remoteMonitor
git clone https://git.sre.ink/go/remoteMonitor.git
cd remoteMonitor
go get github.com/shirou/gopsutil/v3/cpu@v3.21.12
go get github.com/shirou/gopsutil/v3/disk@v3.21.12
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -v -a -o rtm main.go
chmod +x rtm
rm -rf /usr/bin/rtm
mv rtm /usr/bin/
rtm
```
## build
## build amd64 cn
```bash
cd /root
rm -rf remoteMonitor

@ -50,6 +50,9 @@ func get_token(corpid, app_secret string) string {
log.Println(err)
}
token_response := praser_json(string(resp_data))
if token_response == nil {
return ""
}
return token_response["access_token"].(string)
}

Loading…
Cancel
Save