Skip to content

Commit

Permalink
Use fmt.Sprintf()
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunet committed Feb 1, 2022
1 parent c330926 commit 6132539
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions server/events/vcs/bitbucketcloud/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ func (b *Client) UpdateStatus(repo models.Repo, pull models.PullRequest, status
}

// Ensure key has at most 40 characters
if len(src) > 37 {
src = src[:37] + "..."
}
src = fmt.Sprintf("%.37s...", src)

bodyBytes, err := json.Marshal(map[string]string{
"key": src,
Expand Down

0 comments on commit 6132539

Please sign in to comment.