Golang encoding/gob.Encoder.EncodeValue() function example
package encoding/gob
EncodeValue transmits the data item represented by the reflection value, guaranteeing that all necessary type information has been transmitted first.
Golang encoding/gob.Encoder.EncodeValue() function usage example
func (gobCodec) Write(w io.Writer, v reflect.Value, b WriteBasic) (err error) {
if err = binary.Write(w, binary.BigEndian, Gob); err != nil {
return
}
return gob.NewEncoder(w).EncodeValue(v) // <---- here
}
References :
http://golang.org/pkg/encoding/gob/#Encoder.EncodeValue
https://github.com/markchadwick/typedbytes/blob/master/gob.go
Advertisement
Something interesting
Tutorials
+13.9k Golang : How to determine if a year is leap year?
+20.2k Golang : How to get own program name during runtime ?
+22.7k Golang : Strings to lowercase and uppercase example
+12k Golang : Clean formatting/indenting or pretty print JSON result
+8.8k Golang : Heap sort example
+27.2k Golang : Find files by name - cross platform example
+10.9k Golang : How to transmit update file to client by HTTP request example
+16.3k Golang : How to extract links from web page ?
+8.2k Android Studio : Rating bar example
+8k Golang : What fmt.Println() can do and println() cannot do
+5.8k Golang : Launching your executable inside a console under Linux