Last active
January 14, 2026 12:39
-
-
Save pablocattaneo/9e6910937d04ab5982395ec71d908294 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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