From 8b5daebee3198c7b6265b40c06b077be5e4c5b4b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 Jan 2022 14:23:21 -0800 Subject: design/43651-type-parameters: return address in List[T].Range Thanks to Manlio Perillo for pointing this out. Change-Id: I6df29da2810362a6ba51635afbfbe3ab20a010f0 Reviewed-on: https://go-review.googlesource.com/c/proposal/+/379919 Trust: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- design/43651-type-parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design/43651-type-parameters.md b/design/43651-type-parameters.md index ac9219b..ef99dbd 100644 --- a/design/43651-type-parameters.md +++ b/design/43651-type-parameters.md @@ -3784,7 +3784,7 @@ type Iterator[T any] struct { // Range returns an Iterator starting at the head of the list. func (lst *List[T]) Range() *Iterator[T] { - return Iterator[T]{next: &lst.head} + return &Iterator[T]{next: &lst.head} } // Next advances the iterator. -- cgit v1.3