Golang strconv.AppendUint() function example
package strconv
Golang strconv.AppendUint() function usage example.
package main
import (
"fmt"
"strconv"
)
func main() {
//func AppendUint(dst []byte, i uint64, base int) []byte
dst := []byte("Unsigned integer is ")
fmt.Println("Before : ", string(dst))
b := strconv.AppendUint(dst, uint64(1), 10) // base 10 for sanity purpose
fmt.Println("After : ", string(b))
b = strconv.AppendUint(dst, uint64(99), 10) // base 10 for sanity purpose
fmt.Println("After : ", string(b))
}
Output :
Before : Unsigned integer is
After : Unsigned integer is 1
After : Unsigned integer is 99
Reference :
Advertisement
Something interesting
Tutorials
+17.2k Golang : When to use init() function?
+20.7k Golang : Saving private and public key to files
+12.3k Golang : 2 dimensional array example
+5.4k Golang : Reclaim memory occupied by make() example
+23.9k Golang : Fix type interface{} has no field or no methods and type assertions example
+29.4k Golang : JQuery AJAX post data to server and send data back to client example
+9.4k Golang : Create unique title slugs example
+18k Golang : Get all upper case or lower case characters from string example
+6.6k Golang : Warp text string by number of characters or runes example
+22.7k Golang : Round float to precision example
+4.7k JavaScript: Add marker function on Google Map