mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
f0b8f84d37
commit
a0a4e85ad6
3 changed files with 12 additions and 13 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue