Closed candy12t closed 1 month ago
I think path/filepath
is the platform-independent API, whereas path
uses /
path separators. And I believe we do want \
as our path separator on Windows, so this seems like a good change to me?
See godoc: https://pkg.go.dev/path#pkg-overview And https://pkg.go.dev/path/filepath#pkg-overview
@holzensp
Thank you for the comment.
As @bioball said, we want to use \
instead of /
as path separator on Windows.
And, as described in the docs, it's better to use path/filepath
package for operating system paths and path
package for path operations such as URLs.
Package filepath implements utility routines for manipulating filename paths in a way compatible with the target operating system-defined file paths. The filepath package uses either forward slashes or backslashes, depending on the operating system. To process paths such as URLs that always use forward slashes regardless of the operating system, see the path package.
don't use
path
package for operating system paths. usepath/filepath
package instead ofpath
package.