Skip to content

Commit

Permalink
Merge branch 'slices'
Browse files Browse the repository at this point in the history
  • Loading branch information
Himanshuxone committed Oct 16, 2016
2 parents 25a8b1b + 01967b7 commit c71c0b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions slices.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
sliceNum := []int { 5,4,3,2,1 }
fmt.Println( sliceNum[2:] ); // get the value of slice starting from index 2
fmt.Println( sliceNum[:3] ); // get the value of slice starting from 0 index upto index 3
}

0 comments on commit c71c0b5

Please sign in to comment.