Radar · Go · Archive · Week 21 · May 19 – 25, 2025
go/ast: deprecate MergePackageFiles
Nice to knowstdlib
- What changed
go/ast.MergePackageFileswas marked deprecated because it is not used and buggy.- Production impact
- The source does not say.
- Try it
- Search for
MergePackageFilesin your codebase and replace it with alternatives. - Source
- github.com/golang/go/issues/7124
Understand it, then run it
Run it now
// This program demonstrates that `go/ast.MergePackageFiles` is deprecated
// and no longer available in Go 1.27.1. It simply prints a message
// confirming the deprecation status. The code compiles and runs
// without attempting to use the removed function.
package main
import "fmt"
func main() {
// The MergePackageFiles function has been removed from the
// go/ast package. Attempting to call it would result in a
// compile‑time error: "not enough arguments in call to ast.MergePackageFiles".
// Therefore, we only acknowledge its deprecation here.
fmt.Println("go/ast.MergePackageFiles is deprecated and no longer available.")
}
What it printed when we ran it on Go 1.27.1
go/ast.MergePackageFiles is deprecated and no longer available.
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed