loader, iter: add shim for go1.22 and earlier

This commit is contained in:
Randy Reddig
2025-03-08 21:11:08 -08:00
committed by Ron Evans
parent 05fc49a0cf
commit a2be2f3330
2 changed files with 21 additions and 0 deletions
+4
View File
@@ -261,6 +261,10 @@ func pathsToOverride(goMinor int, needsSyscallPackage bool) map[string]bool {
"unique/": false,
}
if goMinor <= 22 {
paths["iter]"] = false
}
if goMinor >= 19 {
paths["crypto/internal/"] = true
paths["crypto/internal/boring/"] = true
+17
View File
@@ -0,0 +1,17 @@
//go:build !go1.23
// Delete this file when TinyGo drops support for Go 1.22.
package iter
// Seq is an iterator over sequences of individual values.
// When called as seq(yield), seq calls yield(v) for each value v in the sequence,
// stopping early if yield returns false.
// See the [iter] package documentation for more details.
type Seq[V any] func(yield func(V) bool)
// Seq2 is an iterator over sequences of pairs of values, most commonly key-value pairs.
// When called as seq(yield), seq calls yield(k, v) for each pair (k, v) in the sequence,
// stopping early if yield returns false.
// See the [iter] package documentation for more details.
type Seq2[K, V any] func(yield func(K, V) bool)