util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExactlyNotSame = errors.New("exactly not same")

ErrExactlyNotSame is used when we can ensure that the result of a/b tests aren't same

Functions

func AffectedRowsMustSame

func AffectedRowsMustSame(rows1, rows2 int64) error

AffectedRowsMustSame return error if both affected rows are not same

func CurrentTimeStrAsLog

func CurrentTimeStrAsLog() string

CurrentTimeStrAsLog return time format as "[2006/01/02 15:06:02.886 +08:00]"

func DirExists

func DirExists(dir string) bool

DirExists checks if a dir exists

func ErrorMustSame

func ErrorMustSame(err1, err2 error) error

ErrorMustSame return error if both error not same

func FileExists

func FileExists(filename string) bool

FileExists checks if a file exists and is not a directory before we try using it to prevent further errors.

func FormatTimeStrAsLog

func FormatTimeStrAsLog(t time.Time) string

FormatTimeStrAsLog format given time as as "[2006/01/02 15:06:02.886 +08:00]"

func Rd

func Rd(n int) int

Rd implement Intn

func RdRange

func RdRange(n, m int) int

RdRange rand between [min(n, m), max(n, m))

func WrapErrExactlyNotSame

func WrapErrExactlyNotSame(format string, args ...interface{}) error

WrapErrExactlyNotSame wraps with ErrExactlyNotSame

Types

This section is empty.

Jump to

Keyboard shortcuts

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