Created
October 20, 2022 00:06
-
-
Save pgaijin66/380a3d815a21d122ec07f09dd812b9c7 to your computer and use it in GitHub Desktop.
1
This file contains 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
package main | |
import ( | |
"fmt" | |
) | |
func main(){ | |
slice := []int{0,1,2,3} | |
fmt.Println(slice) | |
newslice1 := slice[:1] | |
fmt.Println(newslice1) | |
newslice2 := slice[2:] | |
fmt.Println(newslice2) | |
newslice1 = append(newslice1, newslice2...) | |
fmt.Println(newslice1) | |
newslice1 = append(newslice1, newslice2...) | |
fmt.Println(newslice1) | |
fmt.Println(slice) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment