Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since You have migrated to go 1.21, this code is redundant #275

Open
driif opened this issue Mar 3, 2024 · 0 comments
Open

Since You have migrated to go 1.21, this code is redundant #275

driif opened this issue Mar 3, 2024 · 0 comments

Comments

@driif
Copy link

driif commented Mar 3, 2024

https://github.com/allaboutapps/go-starter/blob/c2482d4d3f4ad0e2ceef3bbacf426c5da0ff9ddc/internal/util/slice.go#L3C1-L12C2

Since You have migrated to go 1.21, this code is redundant. In go 1.21 was added a new package "slices to std lib"

import (
  "slices"
)

func IfFooContainsBar() bool {
  return slices.Contains(foo_slice, bar_string)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant