aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/xml/marshal.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-12-03 02:17:34 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-12-03 02:17:34 +0000
commit2fd401c8f190f1fe43e51a7f726f6ed6119a1f96 (patch)
tree7f76eff391f37fe6467ff4ffbc0c582c9959ea30 /libgo/go/xml/marshal.go
parent02e9018f1616b23f1276151797216717b3564202 (diff)
downloadgcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.zip
gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.gz
gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.bz2
libgo: Update to weekly.2011-11-02.
From-SVN: r181964
Diffstat (limited to 'libgo/go/xml/marshal.go')
-rw-r--r--libgo/go/xml/marshal.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/libgo/go/xml/marshal.go b/libgo/go/xml/marshal.go
index 8396dba..691b70d 100644
--- a/libgo/go/xml/marshal.go
+++ b/libgo/go/xml/marshal.go
@@ -7,7 +7,6 @@ package xml
import (
"bufio"
"io"
- "os"
"reflect"
"strconv"
"strings"
@@ -23,7 +22,7 @@ const (
// A Marshaler can produce well-formatted XML representing its internal state.
// It is used by both Marshal and MarshalIndent.
type Marshaler interface {
- MarshalXML() ([]byte, os.Error)
+ MarshalXML() ([]byte, error)
}
type printer struct {
@@ -84,14 +83,14 @@ type printer struct {
// </result>
//
// Marshal will return an error if asked to marshal a channel, function, or map.
-func Marshal(w io.Writer, v interface{}) (err os.Error) {
+func Marshal(w io.Writer, v interface{}) (err error) {
p := &printer{bufio.NewWriter(w)}
err = p.marshalValue(reflect.ValueOf(v), "???")
p.Flush()
return err
}
-func (p *printer) marshalValue(val reflect.Value, name string) os.Error {
+func (p *printer) marshalValue(val reflect.Value, name string) error {
if !val.IsValid() {
return nil
}
@@ -300,6 +299,6 @@ type UnsupportedTypeError struct {
Type reflect.Type
}
-func (e *UnsupportedTypeError) String() string {
+func (e *UnsupportedTypeError) Error() string {
return "xml: unsupported type: " + e.Type.String()
}