Skip to content

Commit

Permalink
internal/task: remove repetition in major Go release tweets
Browse files Browse the repository at this point in the history
There was accidentally one too many "go" in the tweet text
for the major Go release type.

Updates golang/go#47403.
Updates golang/go#40279.

Change-Id: I7983bdb78f22c258121348a6cfaa2ed66592db54
Reviewed-on: https://go-review.googlesource.com/c/build/+/393018
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
  • Loading branch information
dmitshur authored and gopherbot committed Mar 16, 2022
1 parent 567a2d2 commit 1c23949
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions internal/task/tweet.go
Expand Up @@ -217,7 +217,13 @@ func tweetText(r ReleaseTweet, rnd *rand.Rand) (string, error) {
ReleaseTweet: r,
}
} else if strings.Count(r.Version, ".") == 1 { // Major release like "go1.X".
name, data = "major", r
name, data = "major", struct {
Maj string
ReleaseTweet
}{
Maj: r.Version[len("go"):],
ReleaseTweet: r,
}
} else if strings.Count(r.Version, ".") == 2 { // Minor release like "go1.X.Y".
name, data = "minor", struct {
Curr, Prev string
Expand Down Expand Up @@ -279,7 +285,7 @@ const tweetTextTmpl = `{{define "minor" -}}
{{define "major" -}}
{{emoji "release"}} Go {{.Version}} is released!
{{emoji "release"}} Go {{.Maj}} is released!
{{with .Security}}{{emoji "security"}} Security: {{.}}{{"\n\n"}}{{end -}}
Expand Down
2 changes: 1 addition & 1 deletion internal/task/tweet_test.go
Expand Up @@ -128,7 +128,7 @@ go version go1.17rc2 windows/arm64` + "\n",
RandomSeed: 123,
},
wantLog: `tweet text:
🥳 Go go1.17 is released!
🥳 Go 1.17 is released!
🔐 Security: Includes a super duper security fix (CVE-123).
Expand Down

0 comments on commit 1c23949

Please sign in to comment.