changeset 314:adceb47920fb

Cosmetics. Little less structure bloat.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 01 Aug 2018 18:35:30 +0200
parents 10b93a8ee057
children 3ef0521609f5
files controllers/pwreset.go controllers/user.go
diffstat 2 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/controllers/pwreset.go	Wed Aug 01 18:16:14 2018 +0200
+++ b/controllers/pwreset.go	Wed Aug 01 18:35:30 2018 +0200
@@ -362,10 +362,7 @@
 	passwordResetRequests.delete(hash)
 
 	if n, err2 := res.RowsAffected(); err2 == nil && n == 0 {
-		err = JSONError{
-			Code:    http.StatusNotFound,
-			Message: "User not found",
-		}
+		err = JSONError{http.StatusNotFound, "User not found"}
 		return
 	}
 
--- a/controllers/user.go	Wed Aug 01 18:16:14 2018 +0200
+++ b/controllers/user.go	Wed Aug 01 18:35:30 2018 +0200
@@ -132,9 +132,7 @@
 		Code: http.StatusCreated,
 		Result: struct {
 			Result string `json:"result"`
-		}{
-			Result: "success",
-		},
+		}{"success"},
 	}
 	return
 }
@@ -176,9 +174,7 @@
 		Code: http.StatusCreated,
 		Result: struct {
 			Result string `json:"result"`
-		}{
-			Result: "success",
-		},
+		}{"success"},
 	}
 	return
 }
@@ -216,9 +212,7 @@
 	jr = JSONResult{
 		Result: struct {
 			Users []*User `json:"users"`
-		}{
-			Users: users,
-		},
+		}{users},
 	}
 	return
 }