1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 09:52:20 +08:00

fix up core.Resolve a bit

This commit is contained in:
Jeromy
2015-04-22 23:20:22 -07:00
parent e3255f46e1
commit c1560befcd
2 changed files with 8 additions and 6 deletions

View File

@ -45,7 +45,11 @@ func (p Path) String() string {
}
func FromSegments(seg ...string) Path {
return Path(strings.Join(seg, "/"))
var pref string
if seg[0] == "ipfs" || seg[0] == "ipns" {
pref = "/"
}
return Path(pref + strings.Join(seg, "/"))
}
func ParsePath(txt string) (Path, error) {