Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavaggarwal2308 committed Jul 23, 2024
1 parent 71a69f8 commit 3860987
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"reflect"
"slices"
"strings"

"github.com/mattermost/mattermost/server/public/model"
Expand Down Expand Up @@ -35,7 +36,7 @@ const (

// Error Message Constants
unsetMessageError = "welcome message has not been set"
pluginPermissionError = "The `/welcomebot %s` commands can only be executed by the user with a system admin role, team admin role, or channel admin role"
pluginPermissionError = "`/welcomebot %s` commands can only be executed by the user with a system admin role, team admin role, or channel admin role"
)

func getCommand() *model.Command {
Expand Down Expand Up @@ -222,7 +223,7 @@ func (p *Plugin) executeCommandPreview(teamName string, args *model.CommandArgs)
var data string
if err = p.client.KV.Get(key, data); err != nil {
p.postCommandResponse(args, "Error occurred while retrieving the welcome message for the team: `%s`", err.Error())
p.client.Log.Error("Error occured while retrieving team welcome message from KV store.", "TeamID", teamID, "Error", err.Error())
p.client.Log.Error("Error occurred while retrieving team welcome message from KV store.", "TeamID", teamID, "Error", err.Error())
return
}

Expand Down Expand Up @@ -531,7 +532,7 @@ func (p *Plugin) getUniqueTeamsWithWelcomeMsgSlice(teamsWithConfigWelcomeMsg map
}
teamsWithKVWelcomeKeys = append(teamsWithKVWelcomeKeys, team.Name)
}
allTeamNames := append(teamsWithConfigWelcomeKeys, teamsWithKVWelcomeKeys...)
allTeamNames := slices.Concat(teamsWithConfigWelcomeKeys, teamsWithKVWelcomeKeys)

Check failure on line 535 in server/command.go

View workflow job for this annotation

GitHub Actions / plugin-ci / test

undefined: slices.Concat

Check failure on line 535 in server/command.go

View workflow job for this annotation

GitHub Actions / plugin-ci / test

undefined: slices.Concat

// Leverage the unique priniciple of keys in a map to store unique values as they are encountered
teamNameMap := make(map[string]int)
Expand Down

0 comments on commit 3860987

Please sign in to comment.