Skip to content

Commit

Permalink
[MI-3616] Fix failing ci (mattermost#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayusht2810 authored Oct 12, 2023
1 parent bd58e0b commit 0d23ed8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 21 deletions.
2 changes: 1 addition & 1 deletion server/plugin/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ func (p *Plugin) handleOpenStateModal(w http.ResponseWriter, r *http.Request) {
p.returnPostActionIntegrationResponse(w, response)
}

func (p *Plugin) handleGetUsers(w http.ResponseWriter, r *http.Request) {
func (p *Plugin) handleGetUsers(w http.ResponseWriter, _ *http.Request) {
users, err := p.store.GetAllUsers()
if err != nil {
p.API.LogError(constants.ErrorGetUsers, "Error", err.Error())
Expand Down
4 changes: 2 additions & 2 deletions server/plugin/auth_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ func (a *mockAesgcm) NonceSize() int { return 1 }

func (a *mockAesgcm) Overhead() int { return 0 }

func (a *mockAesgcm) Seal(dst, nonce, plaintext, additionalData []byte) []byte { return []byte("mock") }
func (a *mockAesgcm) Seal(_, _, _, _ []byte) []byte { return []byte("mock") }

func (a *mockAesgcm) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) {
func (a *mockAesgcm) Open(_, _, _, _ []byte) ([]byte, error) {
return []byte("mock"), nil
}

Expand Down
4 changes: 2 additions & 2 deletions server/plugin/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (p *Plugin) HandleCreateIncident(args *model.CommandArgs) string {
return ""
}

func (p *Plugin) handleSubscribe(_ *plugin.Context, args *model.CommandArgs, params []string, client Client, _ bool) string {
func (p *Plugin) handleSubscribe(_ *plugin.Context, args *model.CommandArgs, _ []string, _ Client, _ bool) string {
p.API.PublishWebSocketEvent(
constants.WSEventOpenAddSubscriptionModal,
nil,
Expand All @@ -256,7 +256,7 @@ func (p *Plugin) handleSubscribe(_ *plugin.Context, args *model.CommandArgs, par
return ""
}

func (p *Plugin) handleSearchAndShare(_ *plugin.Context, args *model.CommandArgs, params []string, client Client, _ bool) string {
func (p *Plugin) handleSearchAndShare(_ *plugin.Context, args *model.CommandArgs, _ []string, _ Client, _ bool) string {
p.API.PublishWebSocketEvent(
constants.WSEventOpenSearchAndShareRecordsModal,
nil,
Expand Down
14 changes: 4 additions & 10 deletions server/plugin/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ func (s *pluginStore) LoadUser(mattermostUserID string) (*serializer.User, error
}

func (s *pluginStore) StoreUser(user *serializer.User) error {
if err := kvstore.StoreJSON(s.userKV, user.MattermostUserID, user); err != nil {
return err
}

return nil
err := kvstore.StoreJSON(s.userKV, user.MattermostUserID, user)
return err
}

func (s *pluginStore) DeleteUser(mattermostUserID string) error {
Expand All @@ -76,11 +73,8 @@ func (s *pluginStore) DeleteUser(mattermostUserID string) error {
return err
}

if err = s.userKV.Delete(u.MattermostUserID); err != nil {
return err
}

return nil
err = s.userKV.Delete(u.MattermostUserID)
return err
}

func (s *pluginStore) GetAllUsers() ([]*serializer.IncidentCaller, error) {
Expand Down
2 changes: 1 addition & 1 deletion server/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewPlugin() *Plugin {
}

// ServeHTTP demonstrates a plugin that handles HTTP requests
func (p *Plugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) {
func (p *Plugin) ServeHTTP(_ *plugin.Context, w http.ResponseWriter, r *http.Request) {
p.router.ServeHTTP(w, r)
}

Expand Down
7 changes: 2 additions & 5 deletions server/plugin/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ func (p *Plugin) GetUser(mattermostUserID string) (*serializer.User, error) {
}

func (p *Plugin) DisconnectUser(mattermostUserID string) error {
if err := p.store.DeleteUser(mattermostUserID); err != nil {
return err
}

return nil
err := p.store.DeleteUser(mattermostUserID)
return err
}

0 comments on commit 0d23ed8

Please sign in to comment.