Skip to content

Commit

Permalink
loader: merge go.env file which is now required starting in Go 1.21 t…
Browse files Browse the repository at this point in the history
…o correctly get required packages

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram authored and aykevl committed Aug 13, 2023
1 parent 9037bf8 commit 756cdf4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions loader/goroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ func listGorootMergeLinks(goroot, tinygoroot string, overrides map[string]bool)
merges[dir] = filepath.Join(goroot, dir)
}

// Required starting in Go 1.21 due to https://github.com/golang/go/issues/61928
if _, err := os.Stat(filepath.Join(goroot, "go.env")); err == nil {
merges["go.env"] = filepath.Join(goroot, "go.env")
}

return merges, nil
}

Expand Down

0 comments on commit 756cdf4

Please sign in to comment.