Skip to content

Commit 66108fb

Browse files
committed
Add small comment about os.env deduplication
1 parent 5399aea commit 66108fb

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

internal/config/config/env.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ func convertEnvMapToList(envMap map[string]string) []string {
205205
func executeScript(shell string, script string, envMap map[string]string) (string, error) {
206206
cmd := exec.Command(shell, "-c", script)
207207
envList := os.Environ()
208+
// Append resolved env last so it overrides process env keys (Go 1.21+ cmd.Env dedup: last value wins).
208209
envList = append(envList, convertEnvMapToList(envMap)...)
209210
cmd.Env = envList
210211

0 commit comments

Comments
 (0)