Skip to content

Commit

Permalink
fix defer
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Shishkin authored and Alexey Shishkin committed Jul 24, 2023
1 parent 51d8501 commit eba053b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/framework/runner/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"reflect"
"sync"

"github.com/ozontech/allure-go/pkg/allure"
"github.com/ozontech/allure-go/pkg/framework/provider"
Expand All @@ -12,7 +13,7 @@ import (
type suiteResult struct {
Container *allure.Container `json:"container,omitempty"`
TestResults []TestResult `json:"test_results,omitempty"`
mu sync.Mutex
mu sync.Mutex
}

// NewSuiteResult Returns new SuiteResult
Expand All @@ -23,8 +24,9 @@ func NewSuiteResult(container *allure.Container) SuiteResult {
// NewResult appends test result to suite result
func (sr *suiteResult) NewResult(result TestResult) {
sr.mu.Lock()
defer sr.mu.Unlock()

sr.TestResults = append(sr.TestResults, result)
sr.mu.Unlock()
}

// GetContainer returns parent Container
Expand Down

0 comments on commit eba053b

Please sign in to comment.