strconv.AppendUint() Function in Golang With Examples Last Updated : 21 Apr, 2020 Comments Improve Suggest changes Like Article Like Report Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides an AppendUint() function which is used to append the string form of the unsigned integer x, as generated by FormatUint, to num and return the extended buffer. Or in other words, this function converts the uint type integer x to a string and appends it to the end of num. To access AppendUint() function you need to import strconv Package in your program. Syntax: func AppendUint(num []byte, x uint64, base int) []byte Example 1: C // Golang program to illustrate // strconv.AppendUint() function package main import ( "fmt" "strconv" ) func main() { // Converting the unit // type integer x to a string // appends it to the end of // the given []byte // Using AppendUint() function val1 := []byte("uint value (base 16): ") val1 = strconv.AppendUint(val1, 35, 16) fmt.Println(string(val1)) val2 := []byte("uint value (base 10): ") val2 = strconv.AppendUint(val2, 35, 10) fmt.Println(string(val2)) } Output: uint value (base 16): 23 uint value (base 10): 35 Example 2: C // Golang program to illustrate // strconv.AppendUint() function package main import ( "fmt" "strconv" ) func main() { // Converting the unit // type integer x to a string // appends it to the // end of the given []byte // Using AppendUint() function val1 := []byte("uint value (base 16): ") val1 = strconv.AppendUint(val1, 45, 16) fmt.Println(string(val1)) fmt.Println("Length: ", len(val1)) fmt.Println("Capacity: ", cap(val1)) val2 := []byte("uint value (base 10): ") val2 = strconv.AppendUint(val2, 43, 10) fmt.Println(string(val2)) fmt.Println("Length: ", len(val2)) fmt.Println("Capacity: ", cap(val2)) } Output: uint value (base 16): 2d Length: 24 Capacity: 48 uint value (base 10):43 Length: 23 Capacity: 48 Comment More infoAdvertise with us Next Article strconv.AppendFloat() Function in Golang With Examples A ankita_saini Follow Improve Article Tags : Go Language Golang-strconv Similar Reads strconv.AppendInt() Function in Golang With Examples Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides an AppendInt() function which is used to append the string form of the integer val, as generated by FormatInt, to num and returns the extende 2 min read strconv.AppendQuote() Function in Golang With Examples Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides an AppendQuote() function which appends a double-quoted Go string literal representing str, as generated by Quote, to num and returns the ext 2 min read strconv.AppendFloat() Function in Golang With Examples Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides an AppendFloat() function which is used to append the string form of the floating-point number. To access AppendFloat() function you need to 2 min read strconv.AppendBool() Function in Golang With Examples Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides an AppendBool() function which is used to append bool(i.e, true or false) according to the value of num2 to num1 and returns the extended buf 1 min read strconv.AppendQuoteRune() Function in Golang With Examples Go language provides inbuilt support to implement conversions to and from string representations of basic data types with the help of strconv Package. This package provides an AppendQuoteRune() function which appends a single-quoted Go character literal representing the rune x, as generated by Quote 2 min read strconv.Atoi() Function in Golang With Examples Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides an Atoi() function which is equivalent to ParseInt(str string, base int, bitSize int) is used to convert string type into int type. To access 2 min read Like