From b23f67669210dd335daaca7f81ffedadd9e511f3 Mon Sep 17 00:00:00 2001 From: xmdhs Date: Thu, 13 May 2021 21:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E6=9B=B4=E6=96=B0=E6=A3=80?= =?UTF-8?q?=E6=B5=8B):=20=E7=A1=AE=E4=BF=9D=E5=AD=97=E7=AC=A6=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 34b9858..c9811fa 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "encoding/base64" "encoding/json" "errors" "flag" @@ -176,8 +177,13 @@ func check() { log.Println(err) return } + b, err := base64.StdEncoding.DecodeString(version) + if err != nil { + log.Println(err) + return + } u := up{} - err = json.Unmarshal([]byte(version), &u) + err = json.Unmarshal(b, &u) if err != nil { fmt.Println(lang.Lang("checkupdateerr")) fmt.Println(err)