misc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b interface{}) int

func ComputeUnary

func ComputeUnary(op string, input interface{}) (interface{}, error)

func Escape

func Escape(input string, flag EscapeFlag) string

func FirstNonEmptyString

func FirstNonEmptyString(first string, second string, others ...string) string

func FirstNonZeroInt

func FirstNonZeroInt(first, second int, others ...int) int

func FirstNonZeroInt32

func FirstNonZeroInt32(first, second int32, others ...int32) int32

func FirstNonZeroInt64

func FirstNonZeroInt64(first, second int64, others ...int64) int64

func IsBlank

func IsBlank(s string) bool

func IsFloat32Equal

func IsFloat32Equal(f1, f2 float32) bool

func IsFloat64Equal

func IsFloat64Equal(f1, f2 float64) bool

func IsZero

func IsZero(value interface{}) bool

func MustFirstNonEmptyString

func MustFirstNonEmptyString(first, second string, others ...string) string

func PadLeft

func PadLeft(str, pad string, length int) string

func PadRight

func PadRight(str, pad string, length int) string

func SortInt32s

func SortInt32s(s []int32)

func Unescape

func Unescape(s string, ignores ...rune) string

func WriteEscape

func WriteEscape(sb *strings.Builder, input string, flag EscapeFlag)

Types

type EscapeFlag

type EscapeFlag uint8
const (
	EscapeSingleQuote EscapeFlag
	EscapeDoubleQuote
	EscapeLike
)

type Liker

type Liker interface {
	Like(s string) bool
}

func NewLiker

func NewLiker(pattern string) Liker

type Pair

type Pair[L any, R any] struct {
	L L
	R R
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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