encode and decode for nested structures.
fix a bug in delta encoding: only update the delta-base if something is marshaled.
R=rsc
DELTA=154 (94 added, 56 deleted, 4 changed)
OCL=31069
CL=31071
diff --git a/src/pkg/gob/codec_test.go b/src/pkg/gob/codec_test.go
index 4b5169e..339774c 100644
--- a/src/pkg/gob/codec_test.go
+++ b/src/pkg/gob/codec_test.go
@@ -569,10 +569,14 @@
func TestEncode(t *testing.T) {
+ type T2 struct {
+ t string
+ }
type T1 struct {
a, b,c int;
s string;
y []byte;
+ t *T2;
}
t1 := &T1{
a: 17,
@@ -580,6 +584,7 @@
c: -5,
s: "Now is the time",
y: strings.Bytes("hello, sailor"),
+ t: &T2{"this is T2"},
};
b := new(bytes.Buffer);
Encode(b, t1);