Skip to content

Instantly share code, notes, and snippets.

@liggitt
Created November 9, 2015 15:50
Show Gist options
  • Save liggitt/1bb3b39d6cfca8e408b8 to your computer and use it in GitHub Desktop.
Save liggitt/1bb3b39d6cfca8e408b8 to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
s1 := []int{1,2,3,4,5}
s2 := s1[0:1]
s2 = append(s2, -1)
fmt.Println(s1)
fmt.Println(s2)
s3 := []int{1,2,3,4,5}
s4 := s3[0:1:1]
s4 = append(s4, -1)
fmt.Println(s3)
fmt.Println(s4)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment