Standard library / strconv
strconv.FormatBool()
Returns either true or false as lowercase text. Expected stdout: 'false\n'.
Formal Syntax & Structure
go syntaxgo
func FormatBool(b bool) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| b | bool | Boolean value to encode. |
Return Value
string
Encoded representation.
Working Example
Example Snippetgo
package main
import ( "fmt" "strconv")
func main() { fmt.Println(strconv.FormatBool(false))}