summaryrefslogtreecommitdiffstats
path: root/app/audit.go
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-09-25 14:42:06 +0200
committerJoram Wilander <jwawilander@gmail.com>2018-09-25 08:42:06 -0400
commit7636650a25462b0eb3e1ca2f35d8c0d914c40820 (patch)
tree705d570d340436f39c3ae062558df6cea6fced75 /app/audit.go
parent3785ad48c14c2ab9a8c55127b2f2a04cd8b30d6e (diff)
downloadchat-7636650a25462b0eb3e1ca2f35d8c0d914c40820.tar.gz
chat-7636650a25462b0eb3e1ca2f35d8c0d914c40820.tar.bz2
chat-7636650a25462b0eb3e1ca2f35d8c0d914c40820.zip
Migrate to idiomatic error handling app/a*.go and app/b*.go (#9455)
Diffstat (limited to 'app/audit.go')
-rw-r--r--app/audit.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/audit.go b/app/audit.go
index ab38902d5..857c2fa46 100644
--- a/app/audit.go
+++ b/app/audit.go
@@ -8,17 +8,17 @@ import (
)
func (a *App) GetAudits(userId string, limit int) (model.Audits, *model.AppError) {
- if result := <-a.Srv.Store.Audit().Get(userId, 0, limit); result.Err != nil {
+ result := <-a.Srv.Store.Audit().Get(userId, 0, limit)
+ if result.Err != nil {
return nil, result.Err
- } else {
- return result.Data.(model.Audits), nil
}
+ return result.Data.(model.Audits), nil
}
func (a *App) GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) {
- if result := <-a.Srv.Store.Audit().Get(userId, page*perPage, perPage); result.Err != nil {
+ result := <-a.Srv.Store.Audit().Get(userId, page*perPage, perPage)
+ if result.Err != nil {
return nil, result.Err
- } else {
- return result.Data.(model.Audits), nil
}
+ return result.Data.(model.Audits), nil
}