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

address comments from CR

This commit is contained in:
Jeromy
2015-04-23 22:02:33 -07:00
parent 2c1c48a165
commit 6da12b5398
3 changed files with 11 additions and 6 deletions

View File

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