From 9986537cadb0921763cc1496a63e3806b4aac1ac Mon Sep 17 00:00:00 2001 From: Mauri de Souza Meneguzzo Date: Thu, 27 Jun 2024 20:53:04 -0300 Subject: [PATCH] use slices.Clip --- src/cmd/go/internal/base/base.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/internal/base/base.go b/src/cmd/go/internal/base/base.go index fc5a5ade6ff6e8..0ba2ffd415fe43 100644 --- a/src/cmd/go/internal/base/base.go +++ b/src/cmd/go/internal/base/base.go @@ -14,6 +14,7 @@ import ( "os" "os/exec" "reflect" + "slices" "strings" "sync" @@ -211,7 +212,7 @@ func RunStdin(cmdline []string) { cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr - env := cfg.OrigEnv[:len(cfg.OrigEnv):len(cfg.OrigEnv)] + env := slices.Clip(cfg.OrigEnv) env = AppendPATH(env) cmd.Env = env StartSigHandlers()