浏览代码

omitempty (#383)

legolord208 7 年之前
父节点
当前提交
6aec04d69d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      restapi.go

+ 2 - 2
restapi.go

@@ -309,8 +309,8 @@ func (s *Session) UserUpdate(email, password, username, avatar, newPassword stri
 	// If left blank, avatar will be set to null/blank
 
 	data := struct {
-		Email       string `json:"email"`
-		Password    string `json:"password"`
+		Email       string `json:"email,omitempty"`
+		Password    string `json:"password,omitempty"`
 		Username    string `json:"username,omitempty"`
 		Avatar      string `json:"avatar,omitempty"`
 		NewPassword string `json:"new_password,omitempty"`