Skip to content

Commit 8442d08

Browse files
committed
teamcity: fix extra labels logic
I was confused about how closures work, so this caused a stack overflow. This fixes the problem. Epic: CRDB-21133 Release note: None
1 parent 953ea0f commit 8442d08

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/cmd/bazci/githubpost/githubpost.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,13 @@ func getFailurePosterFromFormatterName(formatterName string, extraLabels []strin
120120
reqFromFailure = DefaultFormatter
121121
}
122122
if len(extraLabels) > 0 {
123-
reqFromFailure2 := func(ctx context.Context, f Failure) (issues.IssueFormatter, issues.PostRequest) {
124-
i, r := reqFromFailure(ctx, f)
125-
r.Labels = append(r.Labels, extraLabels...)
126-
return i, r
127-
}
128-
reqFromFailure = reqFromFailure2
123+
reqFromFailure = func(formatter Formatter) Formatter {
124+
return func(ctx context.Context, f Failure) (issues.IssueFormatter, issues.PostRequest) {
125+
i, r := formatter(ctx, f)
126+
r.Labels = append(r.Labels, extraLabels...)
127+
return i, r
128+
}
129+
}(reqFromFailure)
129130
}
130131
return DefaultIssueFilerFromFormatter(reqFromFailure)
131132
}

0 commit comments

Comments
 (0)