booly

package
Version: v0.0.18 Latest Latest
Warning

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

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