Address code review comments.
Refs
package silenced
import (
- "fmt"
"io"
"time"
"github.com/sensu/sensu-go/cli"
"github.com/sensu/sensu-go/cli/commands/flags"
"github.com/sensu/sensu-go/cli/commands/helpers"
+ "github.com/sensu/sensu-go/cli/elements/globals"
"github.com/sensu/sensu-go/cli/elements/table"
"github.com/sensu/sensu-go/types"
"github.com/spf13/cobra"
@@ -69,7 +69,6 @@ func printToTable(results interface{}, writer io.Writer) {
},
{
Title: "Expire",
- ColumnStyle: table.PrimaryTextStyle,
CellTransformer: func(data interface{}) string {
silenced, _ := data.(types.Silenced)
return (time.Duration(silenced.Expire) * time.Second).String()
@@ -77,15 +76,13 @@ func printToTable(results interface{}, writer io.Writer) {
},
{
Title: "ExpireOnResolve",
- ColumnStyle: table.PrimaryTextStyle,
CellTransformer: func(data interface{}) string {
silenced, _ := data.(types.Silenced)
- return fmt.Sprintf("%t", silenced.ExpireOnResolve)
+ return globals.BooleanStyleP(silenced.ExpireOnResolve)
},
},
{
Title: "Creator",
- ColumnStyle: table.PrimaryTextStyle,
CellTransformer: func(data interface{}) string {
silenced, _ := data.(types.Silenced)
return silenced.Creator
@@ -101,7 +98,6 @@ func printToTable(results interface{}, writer io.Writer) {
},
{
Title: "Reason",
- ColumnStyle: table.PrimaryTextStyle,
CellTransformer: func(data interface{}) string {
silenced, _ := data.(types.Silenced)
return silenced.Reason
