Documentation
¶
Overview ¶
Package structs provides utility functions for working with structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](s []T, e T) bool
Contains checks if a slice contains a specific element. It takes a slice and an element as parameters. It returns true if the element is found in the slice, otherwise it returns false.
func MapContains ¶
func MapContains[K comparable, V any](m map[K]V, k K) bool
MapContains checks if a map contains a specific key. It takes a map and a key as parameters. It returns true if the key is found in the map, otherwise it returns false.
func MapKeys ¶
func MapKeys[K comparable, V any](m map[K]V) []K
MapKeys returns all keys from a map. It takes a map as a parameter. It returns a slice containing all keys from the map.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.