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
+7.7k Golang : Generate human readable password
+23.6k Golang : minus time with Time.Add() or Time.AddDate() functions to calculate past date
+23.2k Golang : Print out struct values in string format
+9.9k Golang : Translate language with language package example
+9.4k Golang : Find the length of big.Int variable example
+87.8k Golang : How to convert character to ASCII and back
+14.2k Golang : Chunk split or divide a string into smaller chunk example
+8.1k Golang : Multiplexer with net/http and map
+5.8k Golang : List all packages and search for certain package
+20.2k Golang : Convert seconds to human readable time format example
+10.5k Generate Random number with math/rand in Go