Skip to content

Commit

Permalink
style(lint): make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
wass3r committed Apr 18, 2019
1 parent d1f905f commit 1c0c613
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion remote/discord/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ func (c *Client) Send(message models.Message, bot *models.Bot) {
dg := c.new()
switch message.Type {
case models.MsgTypeDirect, models.MsgTypeChannel:
dg.ChannelMessageSend(message.ChannelID, message.Output)
_, err := dg.ChannelMessageSend(message.ChannelID, message.Output)
if err != nil {
bot.Log.Errorf("Unable to send message: %v", err)
}
default:
bot.Log.Errorf("Unable to send message of type %d", message.Type)
}
Expand Down
2 changes: 1 addition & 1 deletion utils/access_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func isMemberOfGroup(currentUserID string, userGroups []string, bot *models.Bot)
bot.Log.Debugf("Limiting to usergroups only works if you register " +
"your bot as an app with Slack and set the 'slack_workspace_token' property. " +
"Restricting access to rule. Unset 'allow_usergroups' and/or 'ignore_usergroups', or set 'slack_workspace_token'.")
return false, fmt.Errorf("SlackWorkspaceToken not supplied. Restricting access.")
return false, fmt.Errorf("slack_workspace_token not supplied - restricting access")
}
// Check if we are restricting by usergroup
if bot.SlackWorkspaceToken != "" {
Expand Down
2 changes: 1 addition & 1 deletion utils/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

// Match checks given value against given pattern
func Match(pattern, value string, trimInput bool) (string, bool) {
var regx *regexp.Regexp
re := strings.HasPrefix(pattern, "/") && strings.HasSuffix(pattern, "/")
regx := new(regexp.Regexp)

if re {
pattern = strings.Replace(pattern, "/", "", -1)
Expand Down
5 changes: 2 additions & 3 deletions utils/rooms_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (

func TestGetRoomIDs(t *testing.T) {
type args struct {
wantRooms []string
activeRooms map[string]string
bot *models.Bot
wantRooms []string
bot *models.Bot
}

// For Room Exists
Expand Down

0 comments on commit 1c0c613

Please sign in to comment.