Skip to content

Commit

Permalink
Improve text output by printing out successult results
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelSDY committed Dec 17, 2021
1 parent 4ce6fbb commit 9534a5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/env/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (
)

func getAzureFlags() []string {
// IDMS should exist on Azure VMs
// IMDS should exist on Azure VMs
client := &http.Client{
Timeout: time.Second,
}
Expand Down
8 changes: 6 additions & 2 deletions pkg/formatters/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ type TextFormatter struct{}
func (f *TextFormatter) WriteResults(w io.Writer, results []*base.CheckResult) error {
failures := []*base.CheckResult{}
for _, r := range results {
if !r.Ok() {
if r.Ok() {
fmt.Fprintf(w, "[%s] %s\n", r.Checker, r.Description)
} else {
failures = append(failures, r)
}
}

fmt.Fprintf(w, "------------------------------\n")

if len(failures) == 0 {
fmt.Fprintf(w, "All checks passed!\n")
fmt.Fprintf(w, "All %d checks passed!\n", len(results))
return nil
}

Expand Down

0 comments on commit 9534a5b

Please sign in to comment.