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
+13.4k Golang : Get constant name from value
+6.6k Golang : Embedded or data bundling example
+6.2k Golang : Calculate US Dollar Index (DXY)
+8k Golang : Sort words with first uppercase letter
+3.4k Golang : Fix go-cron set time not working issue
+6.8k Golang : Calculate pivot points for a cross
+23.1k Golang : simulate tail -f or read last line from log file example
+19.2k Golang : Populate dropdown with html/template example
+21.1k Golang : Sort and reverse sort a slice of strings
+7.2k CloudFlare : Another way to get visitor's real IP address
+5.4k Golang *File points to a file or directory ?
+11.9k Golang : How to parse plain email text and process email header?