Skip to content

Instantly share code, notes, and snippets.

@NicolaM94
Created July 30, 2023 10:20
Show Gist options
  • Save NicolaM94/4c0f2efedc57c120d3484caf7deb9c74 to your computer and use it in GitHub Desktop.
Save NicolaM94/4c0f2efedc57c120d3484caf7deb9c74 to your computer and use it in GitHub Desktop.
Function to compare two slices
func compareSlices(a, b []int) bool {
if len(a) != len(b) {
return false
}
for i := range a {
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