-
-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It turns out that the syscall package is not only a problem for unix vs windows, but also for unix vs plan9. Thankfully, I forgot that os/exec.ExitError.ExitCode exists, so at least we can still extract exit status codes on all platforms.
- Loading branch information
Showing
6 changed files
with
39 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2017, Daniel Martí <[email protected]> | ||
// See LICENSE for licensing information | ||
|
||
//go:build !windows | ||
|
||
package expand | ||
|
||
func isWindowsErrPathNotFound(error) bool { return false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2017, Daniel Martí <[email protected]> | ||
// See LICENSE for licensing information | ||
|
||
package expand | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
"syscall" | ||
) | ||
|
||
func isWindowsErrPathNotFound(err error) bool { | ||
var pathErr *os.PathError | ||
return errors.As(err, &pathErr) && pathErr.Err == syscall.ERROR_PATH_NOT_FOUND | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters