mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +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
|
|
@ -42,7 +42,7 @@ type WorkspaceSession struct {
|
|||
func (sd *SessionData) Save(c *gin.Context) error {
|
||||
session := ginSessions.Default(c)
|
||||
sessionDataBytes, err := gulu.JSON.MarshalJSON(sd)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
session.Set("data", string(sessionDataBytes))
|
||||
|
|
@ -60,7 +60,7 @@ func GetSession(c *gin.Context) *SessionData {
|
|||
}
|
||||
|
||||
err := gulu.JSON.UnmarshalJSON([]byte(sessionDataStr.(string)), ret)
|
||||
if nil != err {
|
||||
if err != nil {
|
||||
return ret
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue