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:
Kenichi Omichi
2019-03-25 22:07:14 +00:00
parent 9518d522ec
commit e28fb1a1f4
3 changed files with 65 additions and 46 deletions

View File

@@ -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"
}