Skip to content

Commit df26e52

Browse files
committed
remove filepath usage on windows to control output
1 parent d2582ed commit df26e52

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

cli/open.go

+2-13
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"net/url"
77
"path"
88
"path/filepath"
9-
"runtime"
109
"strings"
1110

1211
"github.com/skratchdot/open-golang/open"
@@ -236,13 +235,8 @@ func waitForAgentCond(ctx context.Context, client *codersdk.Client, workspace co
236235
return workspace, workspaceAgent, xerrors.New("watch workspace: unexpected closed channel")
237236
}
238237

239-
// isWindowsAbsPath checks if the path is an absolute path on Windows. On Unix
240-
// systems the check is very simplistic and does not cover edge cases.
238+
// isWindowsAbsPath checks if the path is an absolute path on Windows.
241239
func isWindowsAbsPath(p string) bool {
242-
if runtime.GOOS == "windows" {
243-
return filepath.IsAbs(p)
244-
}
245-
246240
// Remove the drive letter, if present.
247241
if len(p) >= 2 && p[1] == ':' {
248242
p = p[2:]
@@ -259,13 +253,8 @@ func isWindowsAbsPath(p string) bool {
259253
}
260254

261255
// windowsJoinPath joins the elements into a path, using Windows path separator
262-
// and converting forward slashes to backslashes. On Unix systems a very
263-
// simplistic join operator is used.
256+
// and converting forward slashes to backslashes.
264257
func windowsJoinPath(elem ...string) string {
265-
if runtime.GOOS == "windows" {
266-
return filepath.Join(elem...)
267-
}
268-
269258
var s string
270259
for _, e := range elem {
271260
e = strings.ReplaceAll(e, "/", "\\")

0 commit comments

Comments
 (0)