From df5f8fe4dd558f37a795669370965f214db9eec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 22 Feb 2019 17:11:05 +0100 Subject: [PATCH] shell: add a package godoc note for Windows paths As suggested in #356, since this can be a common misconception. --- shell/doc.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shell/doc.go b/shell/doc.go index 695f233c6..96ae5705f 100644 --- a/shell/doc.go +++ b/shell/doc.go @@ -3,4 +3,12 @@ // Package shell contains high-level features that use the syntax, expand, and // interp packages under the hood. +// +// Please note that this package uses POSIX Shell syntax. As such, path names on +// Windows need to use double backslashes or be within single quotes when given +// to functions like Fields. For example: +// +// shell.Fields("echo /foo/bar") // on Unix-like +// shell.Fields("echo C:\\foo\\bar") // on Windows +// shell.Fields("echo 'C:\foo\bar'") // on Windows, with quotes package shell