common

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply[T1 interface{}, T2 interface{}](f func(T1) T2, t1s []T1) []T2

Apply applies the given function to all the items in the list and returns a new list.

func Contains

func Contains[T comparable](t T, ts []T) bool

Contains returns true iff the given item is present in the list.

func Filter

func Filter[T interface{}](f func(T) bool, ts []T) []T

Filter uses the given condition to filter the items in the list and returns a new list.

func FindIndex

func FindIndex[T interface{}](f func(T) bool, ts []T) int

FindIndex returns the index of the first item in the list that satifies the condition. Returns -1 if no item satifies the condition.

func GetPluginDir

func GetPluginDir(name string) string

func GetStorageDir

func GetStorageDir() string

GetStorageDir returns the directory where we store all the plugins.

Types

This section is empty.

Jump to

Keyboard shortcuts

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