summaryrefslogtreecommitdiffstats
path: root/model/authorize.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-01-30 17:23:00 -0600
committerCorey Hulen <corey@hulen.com>2018-01-30 15:23:00 -0800
commit0c8968fb8df4ce302c928118cd81e75f5bef2861 (patch)
treeb17a2ae5afc98f7ce3daaea10a165d9d647c47c5 /model/authorize.go
parentac2e42a480c5bba2e5128017218b0fa1bed8e836 (diff)
downloadchat-0c8968fb8df4ce302c928118cd81e75f5bef2861.tar.gz
chat-0c8968fb8df4ce302c928118cd81e75f5bef2861.tar.bz2
chat-0c8968fb8df4ce302c928118cd81e75f5bef2861.zip
unnamed return (#8170)
Diffstat (limited to 'model/authorize.go')
-rw-r--r--model/authorize.go38
1 files changed, 10 insertions, 28 deletions
diff --git a/model/authorize.go b/model/authorize.go
index df07ff142..2296e7e22 100644
--- a/model/authorize.go
+++ b/model/authorize.go
@@ -115,43 +115,25 @@ func (ad *AuthData) PreSave() {
}
func (ad *AuthData) ToJson() string {
- b, err := json.Marshal(ad)
- if err != nil {
- return ""
- } else {
- return string(b)
- }
+ b, _ := json.Marshal(ad)
+ return string(b)
}
func AuthDataFromJson(data io.Reader) *AuthData {
- decoder := json.NewDecoder(data)
- var ad AuthData
- err := decoder.Decode(&ad)
- if err == nil {
- return &ad
- } else {
- return nil
- }
+ var ad *AuthData
+ json.NewDecoder(data).Decode(&ad)
+ return ad
}
func (ar *AuthorizeRequest) ToJson() string {
- b, err := json.Marshal(ar)
- if err != nil {
- return ""
- } else {
- return string(b)
- }
+ b, _ := json.Marshal(ar)
+ return string(b)
}
func AuthorizeRequestFromJson(data io.Reader) *AuthorizeRequest {
- decoder := json.NewDecoder(data)
- var ar AuthorizeRequest
- err := decoder.Decode(&ar)
- if err == nil {
- return &ar
- } else {
- return nil
- }
+ var ar *AuthorizeRequest
+ json.NewDecoder(data).Decode(&ar)
+ return ar
}
func (ad *AuthData) IsExpired() bool {