util

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(a []string, b string) bool

func FileExists added in v0.13.0

func FileExists(filepath string) (exists, isdir bool, err error)

func Filter

func Filter(a []string, f func(string) bool) []string

Filter returns all values of a for which f returns true.

func Map

func Map[T any](a []T, f func(T) T) []T

Map slice a using f.

func OpenEditor added in v0.13.0

func OpenEditor(editor string) ([]byte, error)

OpenEditor edits a temporary file and returns the content.

func WalkDir added in v0.13.0

func WalkDir(root string) ([]string, error)

Types

type Splitter added in v0.13.0

type Splitter struct {
	// contains filtered or unexported fields
}

func NewSplitter added in v0.13.0

func NewSplitter(token string) *Splitter

func (*Splitter) Parse added in v0.13.0

func (h *Splitter) Parse(s string) (string, string, error)

func (*Splitter) ParseMany added in v0.13.0

func (h *Splitter) ParseMany(values []string) (map[string]string, error)

Jump to

Keyboard shortcuts

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