Documentation ¶
Overview ¶
package bools does conversion to / from booleans and other go standard types
Index ¶
- func FromFloat32(v float32) bool
- func FromFloat64(v float64) bool
- func FromInt(v int) bool
- func FromInt32(v int32) bool
- func FromInt64(v int64) bool
- func FromString(v string) bool
- func ToFloat32(b bool) float32
- func ToFloat64(b bool) float64
- func ToInt(b bool) int
- func ToInt32(b bool) int32
- func ToInt64(b bool) int64
- func ToString(b bool) string
- type BoolSetter
- type Booler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromFloat32 ¶
FromFloat32 converts value to a bool, 0 = false, else true
func FromFloat64 ¶
FromFloat64 converts value to a bool, 0 = false, else true
func FromString ¶
FromString converts string to a bool, "true" = true, else false
Types ¶
type BoolSetter ¶ added in v1.1.16
type BoolSetter interface { Booler // SetBool sets the value from the // boolean representation of the value SetBool(val bool) }
A BoolSetter is a Booler that can also set its value from a bool value
Click to show internal directories.
Click to hide internal directories.