[MM-63345] Address Go v1.23 incompatibility issues with plugins (#30386)

* Address Go v1.23 incompatibility issues with plugins

* Install multiple Go versions for compatibility tests

* Rename
Этот коммит содержится в:
Claudio Costa
2025-03-11 11:44:42 -06:00
коммит произвёл GitHub
родитель 661f7f6a83
Коммит 7c25de2cff
5 изменённых файлов: 186 добавлений и 68 удалений

Просмотреть файл

@@ -15,6 +15,18 @@ import (
)
func CompileGo(t *testing.T, sourceCode, outputPath string) {
compileGo(t, "go", sourceCode, outputPath)
}
func CompileGoVersion(t *testing.T, goVersion, sourceCode, outputPath string) {
var goBin string
if goVersion != "" {
goBin = os.Getenv("GOBIN")
}
compileGo(t, filepath.Join(goBin, "go"+goVersion), sourceCode, outputPath)
}
func compileGo(t *testing.T, goBin, sourceCode, outputPath string) {
dir, err := os.MkdirTemp(".", "")
require.NoError(t, err)
defer os.RemoveAll(dir)
@@ -32,7 +44,7 @@ func CompileGo(t *testing.T, sourceCode, outputPath string) {
serverPath := filepath.Dir(filepath.Dir(sourceFile))
out := &bytes.Buffer{}
cmd := exec.Command("go", "build", "-o", outputPath, main)
cmd := exec.Command(goBin, "build", "-o", outputPath, main)
cmd.Dir = serverPath
cmd.Stdout = out
cmd.Stderr = out