utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayArray

func DisplayArray(arr []string) (out string)

DisplayArray turn an array into a multi-line string containing its items

func SliceFilter

func SliceFilter[S ~[]T, T any](items S, f func(el T) bool) S

SliceFilter returns slice of T for which F returned true

func SliceMap

func SliceMap[S ~[]T, T any, G any](items S, f func(el T) G) []G

SliceMap applies F to all elements in slice of T and returns slice of results

Types

type ErrorWriter

type ErrorWriter struct{}

ErrorWriter is an io.Writer interface which prints to os.Stderr in red

func (*ErrorWriter) Write

func (w *ErrorWriter) Write(s []byte) (int, error)

Jump to

Keyboard shortcuts

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