Golang encoding/gob.Decoder.DecodeValue() function example
package encoding/gob
DecodeValue reads the next value from the input stream. If v(1st parameter) is the zero reflect.Value (v.Kind() == Invalid), DecodeValue discards the value. Otherwise, it stores the value into v. In that case, v must represent a non-nil pointer to data or be an assignable reflect.Value (v.CanSet()) If the input is at EOF, DecodeValue returns io.EOF and does not modify e.
Golang encoding/gob.Decoder.DecodeValue() function usage example
func (ed *encDec) decode(value reflect.Value) error {
ed.decLock.Lock()
err := ed.dec.DecodeValue(value) // <--- here
if err != nil {
return err
}
ed.decLock.Unlock()
return err
}
Reference :
http://golang.org/pkg/encoding/gob/#Decoder.DecodeValue
https://gowalker.org/code.google.com/p/go.exp/old/netchan?f=common.go
Advertisement
Something interesting
Tutorials
+19.6k Golang : Get current URL example
+9.4k Facebook : Getting the friends list with PHP return JSON format
+33.6k Golang : How to check if slice or array is empty?
+8.1k Golang : Variadic function arguments sanity check example
+9.9k Golang : Translate language with language package example
+12.5k Golang : HTTP response JSON encoded data
+14.6k Golang : Send email with attachment(RFC2822) using Gmail API example
+9.2k Golang : Create and shuffle deck of cards example
+29.7k Golang : Record voice(audio) from microphone to .WAV file
+13.7k Golang : Activate web camera and broadcast out base64 encoded images
+5k Google : Block or disable caching of your website content
+32.2k Golang : Convert []string to []byte examples