boolKit

package
v2.1.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringToBool

func StringToBool(str string) bool

StringToBool 类型转换: string => bool

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

func ToBool

func ToBool(obj interface{}) bool

ToBool

e.g. (nil) => false

func ToBoolE

func ToBoolE(obj interface{}) (bool, error)

ToBoolE

e.g. (nil) => false, nil

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