mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02: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
|
@ -49,7 +49,7 @@ func getSnippet(c *gin.Context) {
|
|||
}
|
||||
|
||||
confSnippets, err := model.LoadSnippets()
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = "load snippets failed: " + err.Error()
|
||||
return
|
||||
|
@ -108,7 +108,7 @@ func setSnippet(c *gin.Context) {
|
|||
}
|
||||
|
||||
err := model.SetSnippet(snippets)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = "set snippet failed: " + err.Error()
|
||||
return
|
||||
|
@ -126,7 +126,7 @@ func removeSnippet(c *gin.Context) {
|
|||
|
||||
id := arg["id"].(string)
|
||||
snippet, err := model.RemoveSnippet(id)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
ret.Code = -1
|
||||
ret.Msg = "remove snippet failed: " + err.Error()
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue