From 4d27fb58cf1d593c83568ff378338852c8a9b558 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Wed, 21 Aug 2024 07:15:28 -0700 Subject: [PATCH] Small tweaks to the sample --- examples/range-over-custom-types/range-over-custom-types.go | 6 +++--- .../range-over-custom-types/range-over-custom-types.hash | 4 ++-- public/range-over-custom-types | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/range-over-custom-types/range-over-custom-types.go b/examples/range-over-custom-types/range-over-custom-types.go index 9d6c38aa9..d578bc301 100644 --- a/examples/range-over-custom-types/range-over-custom-types.go +++ b/examples/range-over-custom-types/range-over-custom-types.go @@ -35,7 +35,7 @@ func (lst *List[T]) Push(v T) { } // All returns an _iterator_, which in Go is a function -// with a special signature. +// with a [special signature](https://pkg.go.dev/iter#Seq). func (lst *List[T]) All() iter.Seq[T] { return func(yield func(T) bool) { // The iterator function takes another function as @@ -57,8 +57,8 @@ func main() { lst.Push(13) lst.Push(23) - // Since `List.All` returns an interator, it can be used - // in a regular `range` loop! + // Since `List.All` returns an iterator, we can use it + // in a regular `range` loop. for e := range lst.All() { fmt.Println(e) } diff --git a/examples/range-over-custom-types/range-over-custom-types.hash b/examples/range-over-custom-types/range-over-custom-types.hash index 156f23aab..76c749245 100644 --- a/examples/range-over-custom-types/range-over-custom-types.hash +++ b/examples/range-over-custom-types/range-over-custom-types.hash @@ -1,2 +1,2 @@ -28edd55763e81476f37e68085f5f79555c15ffe8 -Dc3AddmC8Jc +3576a8e614e8e47a0541e800e017d4f9aa2504a3 +q2H-p_moUTy diff --git a/public/range-over-custom-types b/public/range-over-custom-types index ee763a6d2..ddbd0a922 100644 --- a/public/range-over-custom-types +++ b/public/range-over-custom-types @@ -46,7 +46,7 @@ which lets us range over custom types.

- +
package main
@@ -116,7 +116,7 @@ can do it better - as shown below.

All returns an iterator, which in Go is a function -with a special signature.

+with a special signature.