From e5c1b17d772fe3904c6418269967e8395f7bb950 Mon Sep 17 00:00:00 2001 From: Shivashis Padhi Date: Thu, 11 Aug 2022 12:19:25 +0530 Subject: [PATCH] Lint fixes --- api4/insights.go | 8 ++++---- app/post_test.go | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/api4/insights.go b/api4/insights.go index 71a368e96a..0f84e69eec 100644 --- a/api4/insights.go +++ b/api4/insights.go @@ -225,7 +225,7 @@ func getTopChannelsForUserSince(c *Context, w http.ResponseWriter, r *http.Reque js, jsonErr := json.Marshal(topChannels) if jsonErr != nil { - c.Err = model.NewAppError("getTopChannelsForUserSince", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err) + c.Err = model.NewAppError("getTopChannelsForUserSince", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(jsonErr) return } @@ -318,9 +318,9 @@ func getTopThreadsForUserSince(c *Context, w http.ResponseWriter, r *http.Reques return } - js, err := json.Marshal(topThreads) - if err != nil { - c.Err = model.NewAppError("getTopThreadsForUserSince", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err) + js, jsonErr := json.Marshal(topThreads) + if jsonErr != nil { + c.Err = model.NewAppError("getTopThreadsForUserSince", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(jsonErr) return } diff --git a/app/post_test.go b/app/post_test.go index f144b894ca..2ca888c004 100644 --- a/app/post_test.go +++ b/app/post_test.go @@ -3067,8 +3067,6 @@ func TestGetTopDMsForUserSince(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() - th.Server.configStore.SetReadOnlyFF(false) - defer th.Server.configStore.SetReadOnlyFF(true) th.App.UpdateConfig(func(cfg *model.Config) { cfg.FeatureFlags.InsightsEnabled = true }) // users