opentofu/internal/checks/status_string.go
Martin Atkins 9dea19807f checks: A new package for modeling custom condition checks
The checks.Checks type aims to encapsulate keeping track of check results
during a run and then reporting on them afterwards even if the run was
aborted early for some reason.

The intended model here is that each new run starts with an entirely fresh
checks.Checks, with all of the statuses therefore initially unknown, and
gradually populates the check results as we walk the graph in Terraform
Core. This means that even if we don't complete the run due to an error
or due to targeting options we'll still report anything we didn't visit
yet as unknown.

This commit only includes the modeling of checks in the checks package.
For now this is just dead code, and we'll wire it in to Terraform Core in
subsequent commits.
2022-08-26 15:47:29 -07:00

40 lines
831 B
Go

// Code generated by "stringer -type=Status"; DO NOT EDIT.
package checks
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[StatusUnknown-0]
_ = x[StatusPass-80]
_ = x[StatusFail-70]
_ = x[StatusError-69]
}
const (
_Status_name_0 = "StatusUnknown"
_Status_name_1 = "StatusErrorStatusFail"
_Status_name_2 = "StatusPass"
)
var (
_Status_index_1 = [...]uint8{0, 11, 21}
)
func (i Status) String() string {
switch {
case i == 0:
return _Status_name_0
case 69 <= i && i <= 70:
i -= 69
return _Status_name_1[_Status_index_1[i]:_Status_index_1[i+1]]
case i == 80:
return _Status_name_2
default:
return "Status(" + strconv.FormatInt(int64(i), 10) + ")"
}
}