summaryrefslogtreecommitdiffstats
path: root/model/mfa_secret.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/mfa_secret.go')
-rw-r--r--model/mfa_secret.go19
1 files changed, 5 insertions, 14 deletions
diff --git a/model/mfa_secret.go b/model/mfa_secret.go
index 99580f5f3..23a903c89 100644
--- a/model/mfa_secret.go
+++ b/model/mfa_secret.go
@@ -14,21 +14,12 @@ type MfaSecret struct {
}
func (me *MfaSecret) ToJson() string {
- b, err := json.Marshal(me)
- if err != nil {
- return ""
- } else {
- return string(b)
- }
+ b, _ := json.Marshal(me)
+ return string(b)
}
func MfaSecretFromJson(data io.Reader) *MfaSecret {
- decoder := json.NewDecoder(data)
- var me MfaSecret
- err := decoder.Decode(&me)
- if err == nil {
- return &me
- } else {
- return nil
- }
+ var me *MfaSecret
+ json.NewDecoder(data).Decode(&me)
+ return me
}