♻️ Refactor Go to err != nil, err == nil (#12385)

This commit is contained in:
Oleksandr Redko 2024-09-04 04:40:50 +03:00 committed by GitHub
parent 473a159ef2
commit b100721fee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
147 changed files with 1661 additions and 1659 deletions

View file

@ -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