mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
gob: compute information about a user's type once.
Other than maybe cleaning the code up a bit, this has little practical effect for now, but lays the foundation for remembering the method set of a type, which can be expensive. R=rsc CC=golang-dev https://golang.org/cl/4193041
This commit is contained in:
parent
556506e869
commit
14b6a47748
5 changed files with 101 additions and 57 deletions
|
|
@ -984,7 +984,7 @@ func TestInvalidField(t *testing.T) {
|
|||
var bad0 Bad0
|
||||
bad0.ch = make(chan int)
|
||||
b := new(bytes.Buffer)
|
||||
err := nilEncoder.encode(b, reflect.NewValue(&bad0))
|
||||
err := nilEncoder.encode(b, reflect.NewValue(&bad0), userType(reflect.Typeof(&bad0)))
|
||||
if err == nil {
|
||||
t.Error("expected error; got none")
|
||||
} else if strings.Index(err.String(), "type") < 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue