Fixed bug where zero value was not being used
if you read gob docs it states the following: " If a field has the zero value for its type, it is omitted from the transmission." That's powerful savings. I didn't know. Now it works as one would expect.
This commit is contained in:
+2
-2
@@ -49,8 +49,8 @@ func main() {
|
||||
}
|
||||
point.X, point.Y = x, y
|
||||
|
||||
fmt.Printf("sending: %s\n", txt)
|
||||
err = enc.Encode(&point)
|
||||
fmt.Printf("sending: %+v\n", point)
|
||||
err = enc.Encode(point)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user