summaryrefslogtreecommitdiff
path: root/src/pkg/json/struct.go
diff options
context:
space:
mode:
authorMichael Hoisie <hoisie@gmail.com>2009-11-24 13:18:44 -0800
committerMichael Hoisie <hoisie@gmail.com>2009-11-24 13:18:44 -0800
commit41ffb61e93a9567809e00a75560144c7e4b307e9 (patch)
tree88a50143a5d28859927b1e233d5c7bcd39ae41bf /src/pkg/json/struct.go
parent8f498d4386a63d55236f3168832aa223afeff04e (diff)
downloadgolang-41ffb61e93a9567809e00a75560144c7e4b307e9.tar.gz
A quick fix to ensure that json.Marshal returns errors correctly, as well as some error-related tests
R=rsc http://codereview.appspot.com/157151 Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/pkg/json/struct.go')
-rw-r--r--src/pkg/json/struct.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/json/struct.go b/src/pkg/json/struct.go
index 6b74cdae0..8d8663193 100644
--- a/src/pkg/json/struct.go
+++ b/src/pkg/json/struct.go
@@ -392,12 +392,12 @@ func writeValue(w io.Writer, val reflect.Value) (err os.Error) {
*reflect.InterfaceValue,
*reflect.PtrValue,
*reflect.UnsafePointerValue:
- return &MarshalError{val.Type()}
+ err = &MarshalError{val.Type()}
default:
value := val.(reflect.Value);
fmt.Fprint(w, value.Interface());
}
- return nil;
+ return;
}
func Marshal(w io.Writer, val interface{}) os.Error {