Skip to content

Instantly share code, notes, and snippets.

@pablocattaneo
Last active January 14, 2026 12:39
Show Gist options
  • Select an option

  • Save pablocattaneo/9e6910937d04ab5982395ec71d908294 to your computer and use it in GitHub Desktop.

Select an option

Save pablocattaneo/9e6910937d04ab5982395ec71d908294 to your computer and use it in GitHub Desktop.
//slices.Equal(slice1, slice2)
a := [5]int{1, 2, 3, 4, 5}
slices1 := a[1:4] // from index 1 to index 3
sliceCopy := make([]int, len(slices1))
if slices.Equal(slices1, sliceCopy) {
fmt.Println("slices1 and sliceCopy are equal")
} else {
fmt.Println("slices1 and sliceCopy are not equal")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment