filters

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(value string, filters []string) bool

Function to check if a string exists in a slice of strings

It supports the following wildcards as a prefix or suffix. Wildcard is not supported in the middle of the string.

Examples:

  • Match("foo", []string{"foo"}) -> true
  • Match("foo", []string{"bar"}) -> false
  • Match("foo", []string{"*"}) -> true
  • Match("foo", []string{"*o"}) -> true
  • Match("foo", []string{"f*"}) -> true
  • Match("foo", []string{"*f"}) -> false
  • Match("foo", []string{"*o*"}) -> true

Types

This section is empty.

Jump to

Keyboard shortcuts

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