convert output bytearray to string before printing

This commit is contained in:
danbudris
2021-09-17 10:50:22 -04:00
parent e0fb748498
commit 867df407ea

View File

@@ -275,7 +275,7 @@ type analysisOutput struct {
ArchivePath string
}
func (a *analysisOutput) FormattedAnalysisOutput() (outputJson []byte, err error) {
func (a *analysisOutput) FormattedAnalysisOutput() (outputJson string, err error) {
type convertedOutput struct {
ConvertedAnalysis []*convert.Result
ArchivePath string
@@ -290,7 +290,7 @@ func (a *analysisOutput) FormattedAnalysisOutput() (outputJson []byte, err error
formatted, err := json.MarshalIndent(o, "", " ")
if err != nil {
return nil, fmt.Errorf("\r * Failed to format analysis: %v\n", err)
return "", fmt.Errorf("\r * Failed to format analysis: %v\n", err)
}
return formatted, nil
return string(formatted), nil
}