added Name func to ID
This commit is contained in:
parent
2353a0bf53
commit
80302b62f4
@ -80,6 +80,11 @@ func (i ID) Parent() *ID {
|
|||||||
return parent
|
return parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name returns filename or directory name
|
||||||
|
func (i ID) Name() string {
|
||||||
|
return filepath.Base(i.Key)
|
||||||
|
}
|
||||||
|
|
||||||
// ParseID parses a string to an ID. Null if invalid
|
// ParseID parses a string to an ID. Null if invalid
|
||||||
func ParseID(id string) *ID {
|
func ParseID(id string) *ID {
|
||||||
match := idRegex.FindStringSubmatch(id)
|
match := idRegex.FindStringSubmatch(id)
|
||||||
|
Loading…
Reference in New Issue
Block a user