gob: report an error when encoding a non-empty struct with

no public fields.
Fix a couple of tests caught out by this change.

R=rsc
CC=golang-dev
https://golang.org/cl/4044043
This commit is contained in:
Rob Pike 2011-01-22 00:10:11 -08:00
parent f0b8f84d37
commit a0a4e85ad6
3 changed files with 12 additions and 13 deletions

View file

@ -1088,11 +1088,11 @@ func (v Vector) Square() int {
}
type Point struct {
a, b int
X, Y int
}
func (p Point) Square() int {
return p.a*p.a + p.b*p.b
return p.X*p.X + p.Y*p.Y
}
// A struct with interfaces in it.