Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion resolvepath.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

package main

import "strings"
import (
"runtime"
"strings"
)

// resolvePath applies special path segments from refs and applies
// them to base, per RFC 3986.
Expand Down Expand Up @@ -43,5 +46,9 @@ func resolvePath(base, ref string) string {
// Add final slash to the joined path.
dst = append(dst, "")
}

if runtime.GOOS == "windows" {
return strings.TrimPrefix(strings.Join(dst, "/"), "/")
}
return "/" + strings.TrimPrefix(strings.Join(dst, "/"), "/")
}