Files
steampipe/pkg/control/controldisplay/formatter_null.go

29 lines
645 B
Go

package controldisplay
import (
"context"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/control/controlexecute"
"io"
"strings"
)
// NullFormatter is to be used when no output is expected. It always returns a `io.Reader` which
// reads an empty string
type NullFormatter struct {
FormatterBase
}
func (j *NullFormatter) Format(ctx context.Context, tree *controlexecute.ExecutionTree) (io.Reader, error) {
return strings.NewReader(""), nil
}
func (j *NullFormatter) FileExtension() string {
// will not be called
return ""
}
func (j *NullFormatter) Name() string {
return constants.OutputFormatNone
}