chore!(all): attempt to update beego to v2

BREAKING CHANGE: beego has update to v2, and this version of mindoc IS
NOT TESTED AND STABLE!!!
This commit is contained in:
roberChen
2021-03-23 21:55:50 +08:00
parent 79f70d830d
commit 90c1329de2
56 changed files with 1021 additions and 766 deletions

View File

@@ -7,7 +7,7 @@ import (
"net/http"
"os"
"github.com/astaxie/beego"
"github.com/astaxie/beego/logs"
"github.com/mindoc-org/mindoc/conf"
)
@@ -17,14 +17,14 @@ func CheckUpdate() {
resp, err := http.Get("https://api.github.com/repos/lifei6671/mindoc/tags")
if err != nil {
beego.Error("CheckUpdate => ", err)
logs.Error("CheckUpdate => ", err)
os.Exit(1)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
beego.Error("CheckUpdate => ", err)
logs.Error("CheckUpdate => ", err)
os.Exit(1)
}
@@ -35,7 +35,7 @@ func CheckUpdate() {
err = json.Unmarshal(body, &result)
fmt.Println("MinDoc current version => ", conf.VERSION)
if err != nil {
beego.Error("CheckUpdate => ", err)
logs.Error("CheckUpdate => ", err)
os.Exit(0)
}