New plans.Quality type for display-relevant facts about a plan

This commit replaces the existing jsonformat.PlanRendererOpt type with a new
type with identical semantics, located in the plans package.

We needed to be able to exchange the facts represented by
`jsonformat.PlanRendererOpt` across some package boundaries, but the jsonformat
package is implicated in too many dependency chains to be safe for that purpose!
So, we had to make a new one. The plans package seems safe to import from all
the places that must emit or accept this info, and already contains plans.Mode,
which is effectively a sibling of this type.
This commit is contained in:
Nick Fagerlund
2023-06-30 12:24:57 -07:00
committed by Sebastian Rivera
parent da963a13b9
commit 0df3c143bb
6 changed files with 56 additions and 17 deletions

View File

@@ -0,0 +1,24 @@
// Code generated by "stringer -type Quality"; DO NOT EDIT.
package plans
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[Errored-0]
_ = x[NoChanges-1]
}
const _Quality_name = "ErroredNoChanges"
var _Quality_index = [...]uint8{0, 7, 16}
func (i Quality) String() string {
if i < 0 || i >= Quality(len(_Quality_index)-1) {
return "Quality(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _Quality_name[_Quality_index[i]:_Quality_index[i+1]]
}