Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
simplify multi error string method
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Smirnov <[email protected]>
  • Loading branch information
Denys Smirnov authored and dennwc committed Jun 28, 2018
1 parent 485b748 commit 165632b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions request.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package bblfsh

import (
"bytes"
"context"
"io/ioutil"
"path/filepath"
"strings"

"gopkg.in/bblfsh/sdk.v1/protocol"
)
Expand All @@ -15,15 +15,8 @@ type FatalError []string
func (e FatalError) Error() string {
if n := len(e); n == 0 {
return "fatal error"
} else if n == 1 {
return e[0]
}
buf := bytes.NewBuffer(nil)
for _, s := range e {
buf.WriteString(s)
buf.WriteRune('\n')
}
return buf.String()
return strings.Join([]string(e), "\n")
}

// ParseRequest is a parsing request to get the UAST.
Expand Down

0 comments on commit 165632b

Please sign in to comment.