utils

package
v0.0.0-...-00f1f04 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAllDotNumber

func IsAllDotNumber(s string) bool

IsAllDotNumber return true when string s include only number and . (check ipv4 address)

func IsNopError

func IsNopError(err error) bool

IsNopError return true is err is a NopError

func LoopReplaceAll

func LoopReplaceAll(s, old, new string) string

LoopReplaceAll repeatedly replace until nothing changed

func NoSIGHUP

func NoSIGHUP()

NoSIGHUP will ignore HUP signal

func NoSIGPIPE

func NoSIGPIPE()

NoSIGPIPE will ignore PIPE signal

func RandToken

func RandToken(n int) (string, error)

RandToken generates a random hex value. thanks: https://christiangiacomi.com/posts/random-hex-go/

Types

type NopError

type NopError struct{}

NopError represent a error which is not a real error

func (*NopError) Error

func (m *NopError) Error() string

Jump to

Keyboard shortcuts

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