utils

package module
v0.0.0-...-6e0bf2e Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 7 Imported by: 6

Documentation

Overview

Package utils provides a set of helper functions for your application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Array

func Array(values ...string) []string

Array passes in unlimited amount of strings and returns a slice of strings

func ArrayRemove

func ArrayRemove(s []string, r string) []string

ArrayRemove removes an item from a slice of strings

func Dict

func Dict(k string, v string) (ret map[string]string)

Dict is a function that returns a map of strings

func InArray

func InArray(a string, list []string) bool

InArray returns true if the string is in the slice of strings

func InIntArray

func InIntArray(a int, list []int) bool

InIntArray returns true if the int is in the slice of ints

func InterfaceMap

func InterfaceMap() (ret map[string]interface{})

InterfaceMap is a function that returns a map of interfaces

func RandStringRunes

func RandStringRunes(n int) string

RandStringRunes returns a random string of length n

func RandomFloat

func RandomFloat() float32

RandomFloat returns a random float

func ReplaceTokenInFile

func ReplaceTokenInFile(file string, find string, replaceWith string)

ReplaceTokenInFile replaces a token in a file with a find/replace value

func TalkDirty

func TalkDirty(sayWhat string)

TalkDirty is a function that uses say command (linux or mac only if installed) to talk to you in development while your code is running

func TalkDirtySlowly

func TalkDirtySlowly(sayWhat string)

TalkDirtySlowly is a function that uses say (linux or mac only if installed) command to talk to you in development while your code is running, but will wait for the previous say to finish before starting the next line of code

func TalkDirtyToMe

func TalkDirtyToMe(sayWhat string)

TalkDirtyToMe is a function that uses say command (linux or mac only if installed) to talk to you in development while your code is running

Types

This section is empty.

Jump to

Keyboard shortcuts

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