Skip to content

Commit

Permalink
_content/blog: fix example code in range-functions post
Browse files Browse the repository at this point in the history
Lines returns a iter.Seq, not iter.Seq2,
so there's only one value to range over.

Change-Id: I37ea040c73b469978a2e1a78f6436775a7b63d80
Reviewed-on: https://go-review.googlesource.com/c/website/+/611655
Auto-Submit: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
dmitshur authored and gopherbot committed Sep 8, 2024
1 parent 98bee20 commit 4150b91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _content/blog/range-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ func Lines(data []byte) iter.Seq[[]byte] {
Now our code to loop over the lines of a byte slice looks like this.

```
for _, line := range Lines(data) {
for line := range Lines(data) {
handleLine(line)
}
```
Expand Down

0 comments on commit 4150b91

Please sign in to comment.