Skip to content

Commit

Permalink
Ensure init is called in all Renderer methods
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx committed Jan 23, 2021
1 parent ccd9d87 commit d5ccd73
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/display/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func (r *Renderer) Errorf(format string, a ...interface{}) {
}

func (r *Renderer) Heading(text ...string) {
r.init()

fmt.Fprintf(r.MessageWriter, "%s %s\n", ansi.Faint("==="), strings.Join(text, " "))
}

Expand All @@ -77,6 +79,8 @@ type View interface {
}

func (r *Renderer) Results(data []View) {
r.init()

if len(data) > 0 {
switch r.Format {
case OutputFormatJSON:
Expand Down

0 comments on commit d5ccd73

Please sign in to comment.