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:
Lukáš Lalinský 2020-03-03 15:28:06 +01:00 committed by GitHub
parent 321978fa73
commit a93005d73c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,11 @@ type File struct {
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
func (f File) Name() string {
return f.name