Skip to content

Commit 3b431bc

Browse files
committed
feat: underlying with arrays and slices
1 parent cecb934 commit 3b431bc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
a := []int{1, 2, 3, 4, 5, 6}
7+
b := make([]int, len(a))
8+
copy(b, a)
9+
b[0] = 7
10+
fmt.Printf("b: %v\n", b)
11+
fmt.Printf("a: %v\n", a)
12+
13+
}

0 commit comments

Comments
 (0)