Skip to content

Commit

Permalink
fix data race in text ctx [checktoberfest][hacktoberfest]
Browse files Browse the repository at this point in the history
  • Loading branch information
siller174 committed Oct 24, 2024
1 parent d253b39 commit 796493a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions pkg/allure/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func NewResult(testName, fullName string) *Result {
ToPrint: true,
}
result.HistoryID = getMD5Hash(result.TestCaseID)
result.Labels = append(result.Labels, LanguageLabel(runtime.Version()))
result.AddLabel(LanguageLabel(runtime.Version()))
result.Begin()
return &result
}
Expand Down Expand Up @@ -126,13 +126,11 @@ func (result *Result) GetLabels(labelType LabelType) []*Label {

// SetNewLabelMap Adds all passed in arguments `allure.Label` to the report
func (result *Result) SetNewLabelMap(kv map[LabelType]string) {
result.m.Lock()
defer result.m.Unlock()

var labels []*Label
for k, v := range kv {
labels = append(labels, NewLabel(k, v))
}

result.AddLabel(labels...)
}

Expand Down
1 change: 0 additions & 1 deletion pkg/allure/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const (
)

func TestNewResult(t *testing.T) {

result := NewResult(testName, testFullName)
now := GetNow()

Expand Down

0 comments on commit 796493a

Please sign in to comment.