June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package encoding import ( "bytes" "encoding/gob" "fmt" ) // pos stores the x, y position // for Object type pos struct { X int Y int Object string } // GobExample demonstrates using // the gob package func GobExample() error { buffer := bytes.Buffer{} p := pos{ X: 10, Y: 15, Object: "wrench", } // note that if p was an interface // we'd have to call gob.Register first e := gob.NewEncoder(&buffer) ...Read now
Unlock full access