chore: use CLI core wrappers in check output formatting
All checks were successful
Security Scan / security (push) Successful in 14s
All checks were successful
Security Scan / security (push) Successful in 14s
This commit is contained in:
parent
e9e0eccd60
commit
3bcfb589be
1 changed files with 4 additions and 6 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
package cli
|
package cli
|
||||||
|
|
||||||
import "fmt"
|
|
||||||
|
|
||||||
// CheckBuilder provides fluent API for check results.
|
// CheckBuilder provides fluent API for check results.
|
||||||
type CheckBuilder struct {
|
type CheckBuilder struct {
|
||||||
name string
|
name string
|
||||||
|
|
@ -77,15 +75,15 @@ func (c *CheckBuilder) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.duration != "" {
|
if c.duration != "" {
|
||||||
return fmt.Sprintf(" %s %-20s %-10s %s", icon, c.name, status, DimStyle.Render(c.duration))
|
return Sprintf(" %s %-20s %-10s %s", icon, c.name, status, DimStyle.Render(c.duration))
|
||||||
}
|
}
|
||||||
if status != "" {
|
if status != "" {
|
||||||
return fmt.Sprintf(" %s %s %s", icon, c.name, status)
|
return Sprintf(" %s %s %s", icon, c.name, status)
|
||||||
}
|
}
|
||||||
return fmt.Sprintf(" %s %s", icon, c.name)
|
return Sprintf(" %s %s", icon, c.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print outputs the check result.
|
// Print outputs the check result.
|
||||||
func (c *CheckBuilder) Print() {
|
func (c *CheckBuilder) Print() {
|
||||||
fmt.Println(c.String())
|
Println("%s", c.String())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue