forked from ardanlabs/gotraining
/
template1.go
29 lines (19 loc) · 899 Bytes
/
template1.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// All material is licensed under the Apache License Version 2.0, January 2004
// http://www.apache.org/licenses/LICENSE-2.0
// Declare a nil slice of integers. Create a loop that appends 10 values to the
// slice. Iterate over the slice and display each value.
//
// Declare a slice of five strings and initialize the slice with string literal
// values. Display all the elements. Take a slice of index one and two
// and display the index position and value of each element in the new slice.
package main
// Add imports.
func main() {
// Declare a nil slice of integers.
// Appends numbers to the slice.
// Display each value in the slice.
// Declare a slice of strings and populate the slice with names.
// Display each index position and slice value.
// Take a slice of index 1 and 2 of the slice of strings.
// Display each index position and slice values for the new slice.
}