Skip to content

Commit

Permalink
fix: Use ReplaceAll instead of Replace with -1
Browse files Browse the repository at this point in the history
  • Loading branch information
colindean committed Jun 27, 2024
1 parent 6ba463e commit e6a55fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/vela-slack/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ func (p *Plugin) Exec() error {

func cleanBuildMessage(buildMessage string) string {
subject := buildMessage
subject = strings.Replace(subject, "\n", "\\n", -1)
subject = strings.Replace(subject, "\"", "\\\"", -1)
subject = strings.ReplaceAll(subject, "\n", "\\n")
subject = strings.ReplaceAll(subject, "\"", "\\\"")
return subject

Check failure on line 194 in cmd/vela-slack/plugin.go

View workflow job for this annotation

GitHub Actions / diff-review

return statements should not be cuddled if block has more than two lines (wsl)

Check failure on line 194 in cmd/vela-slack/plugin.go

View workflow job for this annotation

GitHub Actions / full-review

return statements should not be cuddled if block has more than two lines (wsl)
}

Expand Down

0 comments on commit e6a55fd

Please sign in to comment.