File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,10 +123,11 @@ func (e *generateError) Error() string {
123123
124124type goimportError struct {
125125 output string
126+ error error
126127}
127128
128129func (e * goimportError ) Error () string {
129- return fmt .Sprintf ("GoImport failed to format:\n %v" , e .output )
130+ return fmt .Sprintf ("GoImport failed to format:\n %v\n %v " , e .output , e . error )
130131}
131132
132133type service struct {
@@ -238,7 +239,7 @@ func main() {
238239 }
239240 out , err := exec .Command ("goimports" , "-w" , outdir ).CombinedOutput ()
240241 if err != nil {
241- errors = append (errors , & goimportError {string (out )})
242+ errors = append (errors , & goimportError {string (out ), err })
242243 }
243244
244245 testdir , err := testDir ()
@@ -247,7 +248,7 @@ func main() {
247248 }
248249 out , err = exec .Command ("goimports" , "-w" , testdir ).CombinedOutput ()
249250 if err != nil {
250- errors = append (errors , & goimportError {string (out )})
251+ errors = append (errors , & goimportError {string (out ), err })
251252 }
252253
253254 if len (errors ) > 0 {
You can’t perform that action at this time.
0 commit comments