mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
♻️ Refactor Go to err != nil, err == nil (#12385)
This commit is contained in:
parent
473a159ef2
commit
b100721fee
147 changed files with 1661 additions and 1659 deletions
|
|
@ -104,7 +104,7 @@ func getNotebookHistory(c *gin.Context) {
|
|||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
histories, err := model.GetNotebookHistory()
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
|
@ -122,7 +122,7 @@ func clearWorkspaceHistory(c *gin.Context) {
|
|||
msgId := util.PushMsg(model.Conf.Language(100), 1000*60*15)
|
||||
time.Sleep(3 * time.Second)
|
||||
err := model.ClearWorkspaceHistory()
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
|
@ -148,7 +148,7 @@ func getDocHistoryContent(c *gin.Context) {
|
|||
keyword = k.(string)
|
||||
}
|
||||
id, rootID, content, isLargeDoc, err := model.GetDocHistoryContent(historyPath, keyword)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
|
@ -174,7 +174,7 @@ func rollbackDocHistory(c *gin.Context) {
|
|||
notebook := arg["notebook"].(string)
|
||||
historyPath := arg["historyPath"].(string)
|
||||
err := model.RollbackDocHistory(notebook, historyPath)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
|
@ -196,7 +196,7 @@ func rollbackAssetsHistory(c *gin.Context) {
|
|||
|
||||
historyPath := arg["historyPath"].(string)
|
||||
err := model.RollbackAssetsHistory(historyPath)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
|
@ -214,7 +214,7 @@ func rollbackNotebookHistory(c *gin.Context) {
|
|||
|
||||
historyPath := arg["historyPath"].(string)
|
||||
err := model.RollbackNotebookHistory(historyPath)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue