Skip to content

Commit 756cdf4

Browse files
deadprogramaykevl
authored andcommitted
loader: merge go.env file which is now required starting in Go 1.21 to correctly get required packages
Signed-off-by: deadprogram <[email protected]>
1 parent 9037bf8 commit 756cdf4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

loader/goroot.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ func listGorootMergeLinks(goroot, tinygoroot string, overrides map[string]bool)
207207
merges[dir] = filepath.Join(goroot, dir)
208208
}
209209

210+
// Required starting in Go 1.21 due to https://github.com/golang/go/issues/61928
211+
if _, err := os.Stat(filepath.Join(goroot, "go.env")); err == nil {
212+
merges["go.env"] = filepath.Join(goroot, "go.env")
213+
}
214+
210215
return merges, nil
211216
}
212217

0 commit comments

Comments
 (0)