Skip to content
Snippets Groups Projects
Commit 2e0a6f85 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Gopher Robot
Browse files

os.Getwd: wrap error on windows and plan9

The errors from os are supposed to be wrapped to add some context,
but in this particular case a raw syscall error is returned.

Change-Id: I1b98dbd7b385c5c1cea79a1b0ec7201ca9bdca40
Reviewed-on: https://go-review.googlesource.com/c/go/+/606657


LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: default avatarIan Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: default avatarCherry Mui <cherryyz@google.com>
parent d2b6bdb0
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,8 @@ var getwdCache struct { ...@@ -21,7 +21,8 @@ var getwdCache struct {
// Getwd may return any one of them. // Getwd may return any one of them.
func Getwd() (dir string, err error) { func Getwd() (dir string, err error) {
if runtime.GOOS == "windows" || runtime.GOOS == "plan9" { if runtime.GOOS == "windows" || runtime.GOOS == "plan9" {
return syscall.Getwd() dir, err = syscall.Getwd()
return dir, NewSyscallError("getwd", err)
} }
// Clumsy but widespread kludge: // Clumsy but widespread kludge:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment