Skip to content

Commit

Permalink
Merge pull request #3 from gnanderson/openSUSE
Browse files Browse the repository at this point in the history
gofix for latest std lib & language changes
  • Loading branch information
StepLg committed Jan 26, 2012
2 parents f154b83 + 5cb3901 commit 7430f14
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
21 changes: 10 additions & 11 deletions src/erx/StringFormatter.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package erx

import (
"strings"
"strconv"
"fmt"
"os"
"io"
"strconv"

"strings"
)

func FormatConsole(w io.Writer, err Error, tab string) {
Expand Down Expand Up @@ -40,19 +40,18 @@ func formatConsole_gen(w io.Writer, err Error, tab string, level int) {
w.Write([]uint8("Scope errors:\n"))
for _, subErr := range subErrs {
switch i := subErr.(type) {
case Error :
formatConsole_gen(w, i, tab, level+1)
case os.Error :
w.Write([]uint8(strings.Repeat(tab, level+1)))
w.Write([]uint8(i.String() + "\n"))
default :
w.Write([]uint8("???\n"))
case Error:
formatConsole_gen(w, i, tab, level+1)
case error:
w.Write([]uint8(strings.Repeat(tab, level+1)))
w.Write([]uint8(i.Error() + "\n"))
default:
w.Write([]uint8("???\n"))
}
}
}
}


// Cut from path first dirs
func transformPath(path string) string {
// finding path in pathCuts to cut
Expand Down
12 changes: 6 additions & 6 deletions src/erx/XMLFormatter.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package erx

import (
"strings"
"strconv"
"fmt"
"os"
"io"
"xml"
"strconv"

"encoding/xml"
"strings"
)

/**
Expand Down Expand Up @@ -71,10 +71,10 @@ func formatSimpleXML_gen(w io.Writer, err Error, indent bool, level int) {
case Error:
formatSimpleXML_gen(w, i, indent, level+1)
w.Write([]uint8(hyphen))
case os.Error:
case error:
w.Write([]uint8(strings.Repeat(tab, level) + "<error type=\"2\">" + hyphen))
w.Write([]uint8(strings.Repeat(tab, level+2)))
escape(w, i.String())
escape(w, i.Error())
w.Write([]uint8(hyphen))
w.Write([]uint8(strings.Repeat(tab, level+1) + "</error>" + hyphen))
default:
Expand Down

0 comments on commit 7430f14

Please sign in to comment.