Skip to content

Commit aa2f873

Browse files
fixing clip example
1 parent 17dd748 commit aa2f873

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

topics/go/packages/slices/example2/example2.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ import (
1313

1414
func main() {
1515
list := make([]string, 0, 10)
16-
fmt.Printf("Len(%d), Cap(%d)\n", len(list), cap(list))
16+
fmt.Printf("Addr(%x), Len(%d), Cap(%d)\n", &list, len(list), cap(list))
1717

1818
// -------------------------------------------------------------------------
1919
// Append a string to the slice
2020

2121
list = append(list, "A")
22-
fmt.Printf("Len(%d), Cap(%d)\n", len(list), cap(list))
22+
fmt.Printf("Addr(%x), Len(%d), Cap(%d)\n", &list[0], len(list), cap(list))
2323

2424
// -------------------------------------------------------------------------
2525
// Clip
2626

2727
list = slices.Clip(list)
28-
fmt.Printf("Len(%d), Cap(%d)\n", len(list), cap(list))
28+
fmt.Printf("Addr(%x), Len(%d), Cap(%d)\n", &list[0], len(list), cap(list))
2929
}

0 commit comments

Comments
 (0)