text

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BestMatch

func BestMatch(a []string, s, def string) string

BestMatch best matches s in a. If no exact match is found, will match with regex `\w*s\w*`. If no regex match, return def.

func Contains

func Contains(a []string, s string) (int, bool)

Contains tells whether a contains s. And return the index of first match. If not found, index is -1.

func SliceToMap added in v1.1.0

func SliceToMap(s []string, d bool) map[string]bool

SliceToMap turns a slice of string into a map, with given default value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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