We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f2fdbe commit 787f61dCopy full SHA for 787f61d
src/cmd/go/internal/work/action.go
@@ -13,6 +13,7 @@ import (
13
"context"
14
"debug/elf"
15
"encoding/json"
16
+ "errors"
17
"fmt"
18
"os"
19
"path/filepath"
@@ -254,7 +255,13 @@ func (b *Builder) Init() {
254
255
} else {
256
tmp, err := os.MkdirTemp(cfg.Getenv("GOTMPDIR"), "go-build")
257
if err != nil {
- base.Fatalf("go: creating work dir: %v", err)
258
+ if errors.Is(err, os.ErrPermission) {
259
+ base.Fatalf("go: creating work dir: %v.\n"+
260
+ "\tRun 'go env -w GOTMPDIR=...' to specify another temporary directory.\n"+
261
+ "\tFor more about GOTMPDIR, see 'go help environment'.", err)
262
+ } else {
263
+ base.Fatalf("go: creating work dir: %v", err)
264
+ }
265
}
266
if !filepath.IsAbs(tmp) {
267
abs, err := filepath.Abs(tmp)
0 commit comments