utils

package
v0.0.0-...-cb66316 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsAtLeast

func ContainsAtLeast(s string, num int, chars string) bool

ContainsAtLeast returns true if s contains at least num chars from chars

func ExitRecover

func ExitRecover(fn func(msg string))

ExitRecover should be used with a defer statement fn is a function that accept a string. It should be used to print the error message

func LengthBetween

func LengthBetween(s string, min, max int) bool

LengthBetween returns true if min <= len(s) < max

func NewConfig

func NewConfig[C any](prefix string) (C, error)

func ToSliceOfAny

func ToSliceOfAny[T any](s []T) []any

Types

type Exit

type Exit struct {
	Code int
	Msg  string
}

Exit a struct that contains the ExitCode and message

Jump to

Keyboard shortcuts

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