Golang strconv.AppendBool() function example
package strconv
Golang strconv.AppendBool() function usage example.
NOTE : Useful in cases where you evaluate the type in select case statement and append the boolean value into the returning slice or array.
package main
import (
"fmt"
"strconv"
)
func main() {
dst := []byte("what is ")
fmt.Println("Before : ", string(dst))
b := strconv.AppendBool(dst, true)
fmt.Println("After : ", string(b))
}
Output :
Before : what is
After : what is true
Reference :
Advertisement
Something interesting
Tutorials
+5.6k Unix/Linux : How to find out the hard disk size?
+13.8k Generate salted password with OpenSSL example
+9.1k Golang : Simple histogram example
+16.6k Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
+5.6k Golang : Detect words using using consecutive letters in a given string
+9.9k Golang : Sort and reverse sort a slice of integers
+11.6k Golang : Display a text file line by line with line number example
+9.3k Golang : How to get username from email address
+10.9k Golang : Create Temporary File
+13.1k Golang : Convert(cast) uintptr to string example
+8.5k Android Studio : Import third-party library or package into Gradle Scripts
+6.1k Golang : Build new URL for named or registered route with Gorilla webtoolkit example