FormatBool in Go

Posted by GoDoc
Public (Editable by Users)

FormatBool returns "true" or "false" according to the value of b.

Go
Edit
package main

import (
	"fmt"
	"strconv"
)

func main() {
	v := true
	s := strconv.FormatBool(v)
	fmt.Printf("%T, %v\n", s, s)
}