Skip to content

Commit 0f1db95

Browse files
cuishuanggopherbot
authored andcommitted
maps, slices: fix variable name and comment in example
Change-Id: I1c837820bdd64b61fca46d45677664b2bb2be606 Reviewed-on: https://go-review.googlesource.com/c/go/+/605356 Commit-Queue: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Run-TryBot: shuang cui <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 65a6e05 commit 0f1db95

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/maps/example_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ func ExampleValues() {
167167
10: "Ten",
168168
1000: "THOUSAND",
169169
}
170-
keys := slices.Sorted(maps.Values(m1))
171-
fmt.Println(keys)
170+
values := slices.Sorted(maps.Values(m1))
171+
fmt.Println(values)
172172
// Output:
173173
// [THOUSAND Ten one]
174174
}

src/slices/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func ExampleSortStableFunc() {
310310
{"Bob", 24},
311311
{"Alice", 55},
312312
}
313-
// Stable sort by name, keeping age ordering of Alices intact
313+
// Stable sort by name, keeping age ordering of Alice intact
314314
slices.SortStableFunc(people, func(a, b Person) int {
315315
return strings.Compare(a.Name, b.Name)
316316
})

0 commit comments

Comments
 (0)