util

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Btoa

func Btoa(boolean bool) string

Converts a boolean to a string.

func Check

func Check(errs ...error)

Checks if one of provided errors != nil

func CountDigits added in v1.2.1

func CountDigits(number int) int

Counts the amount of digits in a number.

Example
fmt.Println(CountDigits(12345))
Output:

5

func Log added in v1.1.0

func Log(must bool, str string)

Runs log.Println(str) if must is true.

func MoveFile added in v1.1.0

func MoveFile(in, out string) error

Move file from path in to out. Uses os.Rename if possible.

func Test added in v1.2.1

func Test[A, W comparable](tests []TestSuite[A, W], toTest func([]A) W, log func(W, W))

Types

type TestSuite

type TestSuite[A, W any] struct {
	Args []A
	Want W
}

A single test suite.

Jump to

Keyboard shortcuts

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