utils

package module
v0.0.0-...-56721df Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 7 Imported by: 0

README

Utils for golang. Following git repository are same:

Usage:

  • Step 1: import
import (
    utils "gitee.com/chuanwan/utils-go"
)
  • Step 2: code
utils.DrivingPanic()
  • Step 3: go mod tidy && go mod vendor

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFileText

func AppendFileText(filePath, newText string)

func Difference

func Difference(slice1 []string, slice2 []string) []string

Difference returns the difference array between two arrays.

func DrivingPanic

func DrivingPanic()

DrivingPanic causes panic.

func DrivingPending

func DrivingPending()

func GetExecDir

func GetExecDir() (string, error)

GetExecDir returns self executable file's directory.

func GetRand

func GetRand(min, max int) int

GetRand returns a random number that conform to min<=[?]<=max. Must call rand.Seed(time.Now().UnixNano()) before using it.

func GracefulSleep

func GracefulSleep(t time.Duration)

func OutputDebug

func OutputDebug(r any, target string)

func OutputMsg

func OutputMsg(msg, target string)

OutputMsg append messages to [target] file using Linux 'echo' command, would create the [target] file if not existed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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