From a93005d73c108ab784f9bc64f98a1c488a60e135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Tue, 3 Mar 2020 15:28:06 +0100 Subject: [PATCH] Add File.Path to return the full path (#34) Very useful when iterating over ReadDir results and wanting to do some operation on them. --- file.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/file.go b/file.go index 200485d..ae2303f 100644 --- a/file.go +++ b/file.go @@ -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