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
+12.2k Golang : Get remaining text such as id or filename after last segment in URL path
+11.3k Golang : Byte format example
+9.7k Golang : Load ASN1 encoded DSA public key PEM file example
+9.9k Golang : Turn string or text file into slice example
+34.6k Golang : How to stream file to client(browser) or write to http.ResponseWriter?
+17.8k Golang : Iterate linked list example
+15.7k Golang : Get checkbox or extract multipart form data value example
+13.7k Golang : Check if an integer is negative or positive
+12.7k Golang : Pass database connection to function called from another package and HTTP Handler
+7k Golang : Gargish-English language translator
+16.4k CodeIgniter/PHP : Create directory if does not exist example
+8k Findstr command the Grep equivalent for Windows