Skip to content

Commit

Permalink
Trim whitespace in channel names (#79)
Browse files Browse the repository at this point in the history
* this solves issue #75 removes whitespace in channel when message is created

* trim whitespace for select output in newmessage
  • Loading branch information
DiptoChakrabarty committed Oct 1, 2021
1 parent d3ce902 commit d992d8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -74,7 +74,7 @@ func ensureNewlines(s string) string {

func newMessage(c Config) Message {
msg := Message{
Channel: selectValue(c.Channel, c.ChannelOnError),
Channel: strings.TrimSpace(selectValue(c.Channel, c.ChannelOnError)),
Text: selectValue(c.Text, c.TextOnError),
Attachments: []Attachment{{
Fallback: ensureNewlines(selectValue(c.Message, c.MessageOnError)),
Expand Down

0 comments on commit d992d8a

Please sign in to comment.