util

package
v0.0.0-...-26838ce Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildTS   = "None"
	BuildHash = "None"
)

Version information.

Functions

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 PrintInfo

func PrintInfo()

PrintInfo prints the octopus version information

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))

Types

This section is empty.

Jump to

Keyboard shortcuts

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