Implement ExportData to filter json fields
In order to filter json fields, the `ExportData` interface needed to be implemented with logic that iterated on the selected fields.
This commit is contained in:
parent
8a1995c98d
commit
ac5510362b
1 changed files with 5 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/cli/cli/v2/api"
|
||||
"github.com/cli/cli/v2/pkg/cmdutil"
|
||||
)
|
||||
|
||||
type check struct {
|
||||
|
|
@ -28,6 +29,10 @@ type checkCounts struct {
|
|||
Canceled int
|
||||
}
|
||||
|
||||
func (ch *check) ExportData(fields []string) map[string]interface{} {
|
||||
return cmdutil.StructExportData(ch, fields)
|
||||
}
|
||||
|
||||
func aggregateChecks(checkContexts []api.CheckContext, requiredChecks bool) (checks []check, counts checkCounts) {
|
||||
for _, c := range eliminateDuplicates(checkContexts) {
|
||||
if requiredChecks && !c.IsRequired {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue