helpers

package
v0.0.438-pre-1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Borrowed from https://www.calhoun.io/creating-random-strings-in-go/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectoryExists

func DirectoryExists(path string) bool

func Duration

func Duration(d time.Duration, dicimal int) time.Duration

func FileExists

func FileExists(path string) bool

func HasPipedStdin

func HasPipedStdin() bool

HasPipedStdin returns if stdin has piped input

func IsTerminal added in v0.0.183

func IsTerminal() bool

func MakeSimpleTable added in v0.0.145

func MakeSimpleTable(out io.Writer, headings []string) (table *tablewriter.Table)

func MkdirAll

func MkdirAll(pathname string) error

func PathRelativeToCWD

func PathRelativeToCWD(path string) string

func RandBytes added in v0.0.348

func RandBytes(n int) ([]byte, error)

RandBytes generates random bytes of a given length See: https://stackoverflow.com/questions/35781197/generating-a-random-fixed-length-byte-array-in-go

func RandString added in v0.0.261

func RandString(n int) (string, error)

RandString returns a string of n bytes, consisting of ASCII letters or numbers.

func ReadStdin

func ReadStdin(maxLength int) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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