Skip to content

Commit

Permalink
Make Ready enum a string
Browse files Browse the repository at this point in the history
This lets us print it (e.g. in logs) in a human-readable way. I
considered using stringer to generate String() methods, but I don't
think we really care about the size/perf benefits of this enum being an
integer.

Signed-off-by: Nic Cope <[email protected]>
  • Loading branch information
negz committed Sep 18, 2023
1 parent c6f16a9 commit 2b44902
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ type DesiredComposed struct {
}

// Ready indicates whether a composed resource should be considered ready.
type Ready int
type Ready string

// Composed resource readiness.
const (
ReadyUnspecified Ready = iota
ReadyTrue
ReadyFalse
ReadyUnspecified Ready = "Unspecified"
ReadyTrue Ready = "True"
ReadyFalse Ready = "False"
)

// NewDesiredComposedResource returns a new, empty desired composed resource.
Expand Down

0 comments on commit 2b44902

Please sign in to comment.