Add File.Path to return the full path (#34)
Very useful when iterating over ReadDir results and wanting to do some operation on them.
This commit is contained in:
parent
321978fa73
commit
a93005d73c
5
file.go
5
file.go
@ -17,6 +17,11 @@ type File struct {
|
|||||||
isdir bool
|
isdir bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Path returns the full path of a file
|
||||||
|
func (f File) Path() string {
|
||||||
|
return f.path
|
||||||
|
}
|
||||||
|
|
||||||
// Name returns the name of a file
|
// Name returns the name of a file
|
||||||
func (f File) Name() string {
|
func (f File) Name() string {
|
||||||
return f.name
|
return f.name
|
||||||
|
Loading…
Reference in New Issue
Block a user