Fix golint failures of e2e/framework/f*.go
This fixes golint failures of the following files: - test/e2e/framework/flake_reporting_util.go - test/e2e/framework/framework.go
This commit is contained in:
@@ -22,12 +22,14 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// FlakeReport is a struct for managing the flake report.
|
||||
type FlakeReport struct {
|
||||
lock sync.RWMutex
|
||||
Flakes []string `json:"flakes"`
|
||||
FlakeCount int `json:"flakeCount"`
|
||||
}
|
||||
|
||||
// NewFlakeReport returns a new flake report.
|
||||
func NewFlakeReport() *FlakeReport {
|
||||
return &FlakeReport{
|
||||
Flakes: []string{},
|
||||
@@ -62,12 +64,14 @@ func (f *FlakeReport) RecordFlakeIfError(err error, optionalDescription ...inter
|
||||
f.FlakeCount++
|
||||
}
|
||||
|
||||
// GetFlakeCount returns the flake count.
|
||||
func (f *FlakeReport) GetFlakeCount() int {
|
||||
f.lock.RLock()
|
||||
defer f.lock.RUnlock()
|
||||
return f.FlakeCount
|
||||
}
|
||||
|
||||
// PrintHumanReadable returns string of flake report.
|
||||
func (f *FlakeReport) PrintHumanReadable() string {
|
||||
f.lock.RLock()
|
||||
defer f.lock.RUnlock()
|
||||
@@ -80,12 +84,14 @@ func (f *FlakeReport) PrintHumanReadable() string {
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
// PrintJSON returns the summary of frake report with JSON format.
|
||||
func (f *FlakeReport) PrintJSON() string {
|
||||
f.lock.RLock()
|
||||
defer f.lock.RUnlock()
|
||||
return PrettyPrintJSON(f)
|
||||
}
|
||||
|
||||
// SummaryKind returns the summary of flake report.
|
||||
func (f *FlakeReport) SummaryKind() string {
|
||||
return "FlakeReport"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user