boolKit

package
v3.0.905 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ToBool = cast.ToBool

	ToBoolE = cast.ToBoolE
)

Functions

func StringToBool

func StringToBool(str string) bool

StringToBool 类型转换: string => bool

PS: 参考了 strconv.ParseBool()、Java hutool中的BooleanUtil.toBoolean().

func ToBoolWithDefault

func ToBoolWithDefault(src interface{}, def bool) bool

func ToString

func ToString(b bool) string

ToString 类型转换: bool => string

e.g. (true) => "true" (false) => "false"

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL