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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user