-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added std out support and namespace functionality
- Loading branch information
bearium
committed
Dec 2, 2019
1 parent
1d3831f
commit e13cb35
Showing
8 changed files
with
149 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package cli | ||
|
||
import ( | ||
"fmt" | ||
|
||
analyzerunner "github.com/replicatedhq/troubleshoot/pkg/analyze" | ||
) | ||
|
||
var failed = false | ||
|
||
func showStdoutResults(preflightName string, analyzeResults []*analyzerunner.AnalyzeResult) error { | ||
fmt.Printf("\n=== TEST %s\n", preflightName) | ||
for _, analyzeResult := range analyzeResults { | ||
fmt.Printf("=== RUN: %s\n", analyzeResult.Title) | ||
} | ||
for _, analyzeResult := range analyzeResults { | ||
outputResult(analyzeResult) | ||
} | ||
if failed { | ||
fmt.Printf("--- FAIL %s\n", preflightName) | ||
fmt.Println("FAILED") | ||
} else { | ||
fmt.Printf("--- PASS %s\n", preflightName) | ||
fmt.Println("PASS") | ||
} | ||
return nil | ||
} | ||
|
||
func outputResult(analyzeResult *analyzerunner.AnalyzeResult) { | ||
if analyzeResult.IsPass { | ||
fmt.Printf(" --- PASS %s\n", analyzeResult.Title) | ||
fmt.Printf(" --- %s\n", analyzeResult.Message) | ||
} else if analyzeResult.IsWarn { | ||
fmt.Printf(" --- WARN: %s\n", analyzeResult.Title) | ||
fmt.Printf(" --- %s\n", analyzeResult.Message) | ||
} else if analyzeResult.IsFail { | ||
failed = true | ||
fmt.Printf(" --- FAIL: %s\n", analyzeResult.Title) | ||
fmt.Printf(" --- %s\n", analyzeResult.Message) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters