Golang strconv.FormatBool() function example

package strconv

Golang strconv.FormatBool() function usage example

 package main

 import (
  "fmt"
  "strconv"
 )

 func main() {

  ok := strconv.FormatBool(true)

  fmt.Println(ok)

  notOk := strconv.FormatBool(false)

  fmt.Println(notOk)

 }

Reference :

http://golang.org/pkg/strconv/#FormatBool

Advertisement