Starting with Go 1.18, you can use the slices package – specifically the generic Contains function: https://pkg.go.dev/golang.org/x/exp/slices#Contains. Note that since this is outside the stdlib as an experimental package,... Read More | Share it now!