Version: v0.0.18 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2021 License: Apache-2.0 Imports: 2 Imported by: 0




This section is empty.


This section is empty.


func Bool

func Bool(v *bool) bool

Bool dereferences and returns bool. The bool default value is returned if v is nil.

func BoolOrDefault

func BoolOrDefault(v *bool, defaultVal bool) *bool

BoolOrDefault returns bool if it is not nil, and a pointer to defaultVal otherwise.

func FromString

func FromString(s string) bool

FromString parses the string to a bool. Valid input values are any casing of "true" and "false", and 1 and 0. If any other input is given, FromString returns false.

func Pointer

func Pointer(v bool) *bool

Pointer returns a pointer to the given bool.

func ToInt

func ToInt(b bool) int

ToInt returns 1 if b is true, and 0 if b is false.

func ToString

func ToString(b bool) string

ToString returns "true" or "false", matching the input bool.


This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL