Create at most just 1 substring when splitting

This commit is contained in:
Kemal Zebari 2024-09-17 16:02:12 -07:00
parent 3cc4fd6564
commit 0983b27d0d
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ func (d discordConvertor) Push(p *api.PushPayload) (DiscordPayload, error) {
// for each commit, generate attachment text
for i, commit := range p.Commits {
// limit the commit message display to just the summary, otherwise it would be hard to read
message := strings.TrimRight(strings.Split(commit.Message, "\n")[0], "\r")
message := strings.TrimRight(strings.SplitN(commit.Message, "\n", 1)[0], "\r")
// a limit of 50 is set because GitHub does the same
if utf8.RuneCountInString(message) > 50 {