boolKit

package
v1.20.100 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToString

func BoolToString(b bool) string

BoolToString 类型转换: bool => string

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

func ParseToBoolWithDefault

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

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

Types

type Boolean

type Boolean struct {
	// contains filtered or unexported fields
}

func NewBoolean

func NewBoolean(value bool) *Boolean

func (*Boolean) GetValue

func (c *Boolean) GetValue() bool

Jump to

Keyboard shortcuts

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