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
+8.8k Android Studio : Image button and button example
+6.8k Android Studio : Hello World example
+24.5k Golang : How to validate URL the right way
+5.2k JavaScript/JQuery : Redirect page examples
+4.8k PHP : Extract part of a string starting from the middle
+25k Golang : Create PDF file from HTML file
+6.1k PageSpeed : Clear or flush cache on web server
+10.6k Golang : How to unmarshal JSON inner/nested value and assign to specific struct?
+5k Linux : How to set root password in Linux Mint
+5.9k AWS S3 : Prevent Hotlinking policy
+9.7k PHP : Get coordinates latitude/longitude from string
+9.4k Golang : Generate EAN barcode