1
0
mirror of https://github.com/golang/go synced 2024-11-25 07:17:56 -07:00

all: rename GOEXPERIMENT=range to rangefunc

Range over integer is enabled now without the GOEXPERIMENT. The
GOEXPERIMENT is only for range over func. Rename it to rangefunc.

For #61405.

Change-Id: I9405fb8e2e30827875716786823856090a1a0cad
Reviewed-on: https://go-review.googlesource.com/c/go/+/539277
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Cherry Mui 2023-11-07 12:01:09 -05:00
parent 3f700ce4d2
commit 45320c23f2
13 changed files with 30 additions and 30 deletions

View File

@ -368,11 +368,11 @@ func TestIssue47243_TypedRHS(t *testing.T) {
}
func TestCheck(t *testing.T) {
old := buildcfg.Experiment.Range
old := buildcfg.Experiment.RangeFunc
defer func() {
buildcfg.Experiment.Range = old
buildcfg.Experiment.RangeFunc = old
}()
buildcfg.Experiment.Range = true
buildcfg.Experiment.RangeFunc = true
DefPredeclaredTestFuncs()
testDirFiles(t, "../../../../internal/types/testdata/check", 50, false) // TODO(gri) narrow column tolerance

View File

@ -1009,7 +1009,7 @@ func rangeKeyVal(typ Type) (key, val Type, cause string, isFunc, ok bool) {
}
return typ.elem, nil, "", false, true
case *Signature:
if !buildcfg.Experiment.Range {
if !buildcfg.Experiment.RangeFunc {
break
}
assert(typ.Recv() == nil)

View File

@ -396,11 +396,11 @@ func TestIssue47243_TypedRHS(t *testing.T) {
}
func TestCheck(t *testing.T) {
old := buildcfg.Experiment.Range
old := buildcfg.Experiment.RangeFunc
defer func() {
buildcfg.Experiment.Range = old
buildcfg.Experiment.RangeFunc = old
}()
buildcfg.Experiment.Range = true
buildcfg.Experiment.RangeFunc = true
DefPredeclaredTestFuncs()
testDirFiles(t, "../../internal/types/testdata/check", false)

View File

@ -994,7 +994,7 @@ func rangeKeyVal(typ Type) (key, val Type, cause string, isFunc, ok bool) {
}
return typ.elem, nil, "", false, true
case *Signature:
if !buildcfg.Experiment.Range {
if !buildcfg.Experiment.RangeFunc {
break
}
assert(typ.Recv() == nil)

View File

@ -1,8 +0,0 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.range
package goexperiment
const Range = false
const RangeInt = 0

View File

@ -1,8 +0,0 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.range
package goexperiment
const Range = true
const RangeInt = 1

View File

@ -0,0 +1,8 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build !goexperiment.rangefunc
package goexperiment
const RangeFunc = false
const RangeFuncInt = 0

View File

@ -0,0 +1,8 @@
// Code generated by mkconsts.go. DO NOT EDIT.
//go:build goexperiment.rangefunc
package goexperiment
const RangeFunc = true
const RangeFuncInt = 1

View File

@ -114,6 +114,6 @@ type Flags struct {
// inlining phase within the Go compiler.
NewInliner bool
// Range enables range over int and func.
Range bool
// RangeFunc enables range over func.
RangeFunc bool
}

View File

@ -1,4 +1,4 @@
// -goexperiment=range
// -goexperiment=rangefunc
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style

View File

@ -1,4 +1,4 @@
// errorcheck -goexperiment range
// errorcheck -goexperiment rangefunc
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style

View File

@ -1,4 +1,4 @@
// run -goexperiment range
// run -goexperiment rangefunc
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style

View File

@ -1,4 +1,4 @@
// runoutput -goexperiment range
// runoutput -goexperiment rangefunc
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style