These were previously only available with GOEXPERIMENT=rangefunc.
For #61897.
Change-Id: I86aea5ae8be1f7a2975b623325811221ed40d384
Reviewed-on: https://go-review.googlesource.com/c/go/+/557836
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
--- /dev/null
+pkg iter, func Pull2[$0 interface{}, $1 interface{}](Seq2[$0, $1]) (func() ($0, $1, bool), func()) #61897
+pkg iter, func Pull[$0 interface{}](Seq[$0]) (func() ($0, bool), func()) #61897
+pkg iter, type Seq2[$0 interface{}, $1 interface{}] func(func($0, $1) bool) #61897
+pkg iter, type Seq[$0 interface{}] func(func($0) bool) #61897
--- /dev/null
+### Iterators
+
+The new [`iter` package](/pkg/iter/) provides the basic definitions for
+working with user-defined iterators.
--- /dev/null
+<!-- see ../../3-iter.md -->
< internal/reflectlite
< errors
< internal/oserror, math/bits
+ < iter
< RUNTIME;
- internal/race
- < iter;
-
# slices depends on unsafe for overlapping check, cmp for comparison
# semantics, and math/bits for # calculating bitlength of numbers.
unsafe, cmp, math/bits
internal/nettrace,
internal/poll,
internal/singleflight,
- internal/race,
net/netip,
os
< net;
"html",
"image",
"io",
+ "iter",
"log",
"maps",
"math",
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build goexperiment.rangefunc
-
// Package iter provides basic definitions and operations
// related to iteration in Go.
-//
-// This package is experimental and can only be imported
-// when building with GOEXPERIMENT=rangefunc.
package iter
import (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build goexperiment.rangefunc
-
-package iter
+package iter_test
import (
"fmt"
+ . "iter"
"runtime"
"testing"
)
}
func TestPull(t *testing.T) {
-
for end := 0; end <= 3; end++ {
t.Run(fmt.Sprint(end), func(t *testing.T) {
ng := runtime.NumGoroutine()