@@ -45,7 +45,7 @@ func (r ListAnalyzeResult) OutputText(resultType string) error {
45
45
analysis , valid := r .Analysis .([]string )
46
46
if ! valid {
47
47
logrus .Error ("Unexpected structure of Analysis. Should be of type []string" )
48
- return errors . New ( fmt .Sprintf ("Could not output %s analysis result" , r .AnalyzeType ) )
48
+ return fmt .Errorf ("Could not output %s analysis result" , r .AnalyzeType )
49
49
}
50
50
r .Analysis = analysis
51
51
@@ -58,7 +58,7 @@ func (r MultiVersionPackageAnalyzeResult) OutputStruct() interface{} {
58
58
analysis , valid := r .Analysis .(map [string ]map [string ]PackageInfo )
59
59
if ! valid {
60
60
logrus .Error ("Unexpected structure of Analysis. Should be of type map[string]map[string]PackageInfo" )
61
- return errors . New ( fmt .Sprintf ("Could not output %s analysis result" , r .AnalyzeType ) )
61
+ return fmt .Errorf ("Could not output %s analysis result" , r .AnalyzeType )
62
62
}
63
63
analysisOutput := getMultiVersionPackageOutput (analysis )
64
64
output := struct {
@@ -77,7 +77,7 @@ func (r MultiVersionPackageAnalyzeResult) OutputText(resultType string) error {
77
77
analysis , valid := r .Analysis .(map [string ]map [string ]PackageInfo )
78
78
if ! valid {
79
79
logrus .Error ("Unexpected structure of Analysis. Should be of type map[string]map[string]PackageInfo" )
80
- return errors . New ( fmt .Sprintf ("Could not output %s analysis result" , r .AnalyzeType ) )
80
+ return fmt .Errorf ("Could not output %s analysis result" , r .AnalyzeType )
81
81
}
82
82
analysisOutput := getMultiVersionPackageOutput (analysis )
83
83
@@ -100,7 +100,7 @@ func (r SingleVersionPackageAnalyzeResult) OutputStruct() interface{} {
100
100
analysis , valid := r .Analysis .(map [string ]PackageInfo )
101
101
if ! valid {
102
102
logrus .Error ("Unexpected structure of Analysis. Should be of type map[string]PackageInfo" )
103
- return errors . New ( fmt .Sprintf ("Could not output %s analysis result" , r .AnalyzeType ) )
103
+ return fmt .Errorf ("Could not output %s analysis result" , r .AnalyzeType )
104
104
}
105
105
analysisOutput := getSingleVersionPackageOutput (analysis )
106
106
output := struct {
@@ -119,7 +119,7 @@ func (r SingleVersionPackageAnalyzeResult) OutputText(diffType string) error {
119
119
analysis , valid := r .Analysis .(map [string ]PackageInfo )
120
120
if ! valid {
121
121
logrus .Error ("Unexpected structure of Analysis. Should be of type map[string]PackageInfo" )
122
- return errors . New ( fmt .Sprintf ("Could not output %s analysis result" , r .AnalyzeType ) )
122
+ return fmt .Errorf ("Could not output %s analysis result" , r .AnalyzeType )
123
123
}
124
124
analysisOutput := getSingleVersionPackageOutput (analysis )
125
125
0 commit comments