(slice []T, test func(T) bool)
| 64 | } |
| 65 | |
| 66 | func 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 | |
| 76 | func GetContext(c *gin.Context) (config.UserContext, error) { |
| 77 | userContextValue, exists := c.Get("context") |
no outgoing calls