stringutil

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(prev, next []string) (added []string, removed []string)

Diff examines two unordered lists of strings and calculates the items that should be removed (exist only in the first argument) and added (exist only in the second argument).

Compare to POSIX `comm` command.

func RemoveAll

func RemoveAll(s string, cutset string) string

func RemoveAllFunc

func RemoveAllFunc(s string, f func(rune) bool) string

func Uniques

func Uniques(items []string) []string

Uniques takes two sorted lists and removes duplicates. It does not modify the underlying list.

Compare to POSIX `uniq` command.

Types

type StringArray

type StringArray []string

StringArray is a type that can be unmarshalled from yaml as either a `string` or as a `[]string` and will always result in a `[]string`

func (*StringArray) UnmarshalYAML

func (a *StringArray) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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