MCPcopy Index your code
hub / github.com/tinyauthapp/tinyauth / Filter

Function Filter

internal/utils/app_utils.go:66–74  ·  view source on GitHub ↗
(slice []T, test func(T) bool)

Source from the content-addressed store, hash-verified

64}
65
66func Filter[T any](slice []T, test func(T) bool) (res []T) {
67 res = make([]T, 0)
68 for _, value := range slice {
69 if test(value) {
70 res = append(res, value)
71 }
72 }
73 return res
74}
75
76func GetContext(c *gin.Context) (config.UserContext, error) {
77 userContextValue, exists := c.Get("context")

Callers 2

TestFilterFunction · 0.92
filterScopesMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestFilterFunction · 0.74