Golang encoding/binary.PutVarint() function example
package encoding/binary
PutVarint encodes an int64 into buf(1st parameter) and returns the number of bytes written. If the buffer is too small, PutVarint will panic.
Golang encoding/binary.PutVarint() function usage example
var l64 int64
l64 = int64(len("abcdefg"))
lenstore := make([]byte, 8)
binary.PutVarint(lenstore, l64)
Reference :
Advertisement
Something interesting
Tutorials
+19.5k Golang : Example for DSA(Digital Signature Algorithm) package functions
+34.6k Golang : How to stream file to client(browser) or write to http.ResponseWriter?
+5.7k List of Golang XML tutorials
+8.8k Golang : Take screen shot of browser with JQuery example
+11.5k Use systeminfo to find out installed Windows Hotfix(s) or updates
+26k Golang : Convert IP address string to long ( unsigned 32-bit integer )
+11.2k Google Maps URL parameters configuration
+5.6k Golang : Detect words using using consecutive letters in a given string
+9.7k Golang : Populate slice with sequential integers example
+21.7k Golang : Setting up/configure AWS credentials with official aws-sdk-go
+20.4k nginx: [emerg] unknown directive "passenger_enabled"
+13.2k CodeIgniter : "Fatal error: Cannot use object of type stdClass as array" message