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 c024330
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions server/events/vcs/bitbucketcloud/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,9 @@ func (b *Client) UpdateStatus(repo models.Repo, pull models.PullRequest, status
url = b.AtlantisURL
}

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

bodyBytes, err := json.Marshal(map[string]string{
"key": src,
// Ensure key has at most 40 characters
"key": fmt.Sprintf("%.37s...", src),
"url": url,
"state": bbState,
"description": description,
Expand Down

0 comments on commit c024330

Please sign in to comment.