From 7636650a25462b0eb3e1ca2f35d8c0d914c40820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 25 Sep 2018 14:42:06 +0200 Subject: Migrate to idiomatic error handling app/a*.go and app/b*.go (#9455) --- app/audit.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/audit.go') 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 } -- cgit v1.2.3-1-g7c22