Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions result/overall.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ type PartialResult struct {
defaultStateSet bool // nolint: unused
}

// Initializer for a PartialResult with "sane" defaults
// Notable default compared to the nil object: the default state is set to Unknown
func NewPartialResult() PartialResult {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look alright. But could you add a doc string for the function, maybe describe why the defaults are what they are?

return PartialResult{
stateSetExplicitly: false,
defaultState: check.Unknown,
}
}

// String returns the status and output of the PartialResult
func (s *PartialResult) String() string {
return fmt.Sprintf("[%s] %s", check.StatusText(s.GetStatus()), s.Output)
Expand Down