Skip to content

Commit c78e837

Browse files
committed
Update success and failing state comments
Signed-off-by: Charlie Egan <[email protected]>
1 parent af6d061 commit c78e837

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/results/results.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ type Result struct {
2727
Package string
2828
}
2929

30-
// IsSuccessState returns true if Value is boolean and it is true.
30+
// IsSuccessState returns true if there are no Violations
31+
// If Violations are missing, the Value is parsed and if it is a bool that is used, otherwise false
3132
func (r *Result) IsSuccessState() bool {
3233
if r.Violations != nil {
3334
return len(r.Violations) == 0
@@ -42,7 +43,8 @@ func (r *Result) IsSuccessState() bool {
4243
}
4344
}
4445

45-
// IsFailureState returns true if Value is boolean and it is false.
46+
// IsFailureState returns true if there are Violations
47+
// If Violations are missing, the Value is parsed and if it is a bool that is negated and returned, otherwise false
4648
func (r *Result) IsFailureState() bool {
4749
if r.Violations != nil {
4850
return len(r.Violations) != 0

0 commit comments

Comments
 (0)