6
6
"net/url"
7
7
"path"
8
8
"path/filepath"
9
- "runtime"
10
9
"strings"
11
10
12
11
"github.com/skratchdot/open-golang/open"
@@ -236,13 +235,8 @@ func waitForAgentCond(ctx context.Context, client *codersdk.Client, workspace co
236
235
return workspace ,workspaceAgent ,xerrors .New ("watch workspace: unexpected closed channel" )
237
236
}
238
237
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.
241
239
func isWindowsAbsPath (p string )bool {
242
- if runtime .GOOS == "windows" {
243
- return filepath .IsAbs (p )
244
- }
245
-
246
240
// Remove the drive letter, if present.
247
241
if len (p )>= 2 && p [1 ]== ':' {
248
242
p = p [2 :]
@@ -259,13 +253,8 @@ func isWindowsAbsPath(p string) bool {
259
253
}
260
254
261
255
// 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.
264
257
func windowsJoinPath (elem ... string )string {
265
- if runtime .GOOS == "windows" {
266
- return filepath .Join (elem ... )
267
- }
268
-
269
258
var s string
270
259
for _ ,e := range elem {
271
260
e = strings .ReplaceAll (e ,"/" ,"\\ " )