Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf26e52

Browse files
committed
remove filepath usage on windows to control output
1 parentd2582ed commitdf26e52

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

‎cli/open.go‎

Lines changed: 2 additions & 13 deletions
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
returnworkspace,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
funcisWindowsAbsPath(pstring)bool {
242-
ifruntime.GOOS=="windows" {
243-
returnfilepath.IsAbs(p)
244-
}
245-
246240
// Remove the drive letter, if present.
247241
iflen(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
funcwindowsJoinPath(elem...string)string {
265-
ifruntime.GOOS=="windows" {
266-
returnfilepath.Join(elem...)
267-
}
268-
269258
varsstring
270259
for_,e:=rangeelem {
271260
e=strings.ReplaceAll(e,"/","\\")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp