Skip to content

Instantly share code, notes, and snippets.

@YakDriver
Created February 5, 2021 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YakDriver/6d9241ef15b23ed1b30a19b6f6dcaef0 to your computer and use it in GitHub Desktop.
Save YakDriver/6d9241ef15b23ed1b30a19b6f6dcaef0 to your computer and use it in GitHub Desktop.
func compareStringSlices(a []string, b []string) bool {
if len(a) != len(b) {
return false
}
sort.Strings(a)
sort.Strings(b)
for i := range b {
if a[i] != b[i] {
return false
}
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment