more gob bugs

1) need to send slice and array types (was only sending element types)
2) compatibleType needs to use decoder's type map

R=rsc
CC=golang-dev
https://golang.org/cl/164062
This commit is contained in:
Rob Pike 2009-12-01 15:31:28 -08:00
parent 749da968e4
commit a0f742d343
4 changed files with 69 additions and 25 deletions

View file

@ -213,3 +213,15 @@ func TestTypeToPtrPtrPtrPtrType(t *testing.T) {
t.Errorf("wrong value after decode: %g not %g", ****(****t2pppp).a, ****t2.a)
}
}
func TestSlice(t *testing.T) {
// Encode a *T, decode a T
type Type3 struct {
a []string;
}
t3p := &Type3{[]string{"hello", "world"}};
var t3 Type3;
if err := encAndDec(t3, t3p); err != nil {
t.Error(err)
}
}