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
+8.2k Golang : Qt splash screen with delay example
+5.2k Golang : The Tao of importing package
+4.8k Which content-type(MIME type) to use for JSON data
+18.7k Golang : convert int to string
+5.7k Golang : ROT32768 (rotate by 0x80) UTF-8 strings example
+10.6k Golang : Flip coin example
+8.1k Golang : How To Use Panic and Recover
+22.6k Generate checksum for a file in Go
+26.4k Golang : Convert(cast) string to uint8 type and back to string
+6.9k Golang : Fibonacci number generator examples
+8.8k Android Studio : Image button and button example