-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: restore support and testing of Go 1.22.0
- relax go directive to 1.22.0 to match the N-1 and N support statement and permit run/build with go1.22.0 and newer - update the test fixtures go.mod similarly to make them representative - use the toolchain directive to _recommend_ the latest 1.23.x (Go treats this as advisory) - fix the CI build so that oldstable and stable are actually being tested by telling setup-go to ignore the toolchain directive - use go build tags to add a stub for types.Alias on go1.22 and (somewhat ironically!) use a simple type Alias to the builtin on go1.23 and newer Fixes #312 Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
- Loading branch information
Showing
9 changed files
with
75 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
module github.com/maxbrunsfeld/counterfeiter/v6/fixtures/dup_packages | ||
|
||
go 1.22 | ||
go 1.22.0 | ||
|
||
toolchain go1.23.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
module github.com/maxbrunsfeld/counterfeiter/v6/fixtures/hyphenated_package_same_name | ||
|
||
go 1.22.0 | ||
|
||
toolchain go1.23.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
module github.com/maxbrunsfeld/counterfeiter/v6/fixtures/type_aliases | ||
|
||
go 1.22 | ||
go 1.22.0 | ||
|
||
toolchain go1.23.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//go:build !go1.23 | ||
|
||
package generator | ||
|
||
import ( | ||
"go/types" | ||
) | ||
|
||
var _ namedType = &typesAlias{} | ||
|
||
type typesAlias struct{} | ||
|
||
func (a *typesAlias) Obj() *types.TypeName { | ||
panic("counterfeiter itself must be run/built with go1.23 or newer in order to handle type aliasing") | ||
} | ||
|
||
func (a *typesAlias) String() string { | ||
panic("counterfeiter itself must be run/built with go1.23 or newer in order to handle type aliasing") | ||
} | ||
|
||
func (a *typesAlias) TypeArgs() *types.TypeList { | ||
panic("counterfeiter itself must be run/built with go1.23 or newer in order to handle type aliasing") | ||
} | ||
|
||
func (a *typesAlias) Underlying() types.Type { | ||
panic("counterfeiter itself must be run/built with go1.23 or newer in order to handle type aliasing") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//go:build go1.23 | ||
|
||
package generator | ||
|
||
import ( | ||
"go/types" | ||
) | ||
|
||
var _ types.Type = &typesAlias{} | ||
|
||
type typesAlias = types.Alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters