Skip to content

Commit e0ece0d

Browse files
committed
cmd/{apidiff,gorelease}: use types.Alias when >= 1.23
This module's go.mod file specifies go1.22. These two programs use go/types, which materializes aliases as type.Alias when the go version is >= 1.23. Force that materialization with toolchains >= 1.23 despite what the go.mod says. Fixes golang/go#70695. Change-Id: I9401d7f80880fdf59600592baf93bb4c8b7c76ec Reviewed-on: https://go-review.googlesource.com/c/exp/+/645015 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent 3edf0e9 commit e0ece0d

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

cmd/apidiff/gotypesalias.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2025 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

cmd/apidiff/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2025 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
15
// Command apidiff determines whether two versions of a package are compatible
26
package main
37

cmd/gorelease/gotypesalias.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2025 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
//go:build go1.23
6+
7+
//go:debug gotypesalias=1
8+
9+
package main
10+
11+
// Materialize aliases whenever the go toolchain version is after 1.23 (#69772).
12+
// Remove this file after go.mod >= 1.23 (which implies gotypesalias=1).

0 commit comments

Comments
 (0)