From f0aceb2cb00fad2da4024e19b6af3a80f4cdf828 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Fri, 29 Jul 2022 20:29:25 +0200 Subject: [PATCH] Tweak comment regarding relative paths (#466) Clarify what "relative" means here. Fixes #362 --- fsnotify.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fsnotify.go b/fsnotify.go index 3fbc792..6a305b5 100644 --- a/fsnotify.go +++ b/fsnotify.go @@ -16,8 +16,15 @@ import ( // Event represents a single file system notification. type Event struct { - Name string // Relative path to the file or directory. - Op Op // File operation that triggered the event. + // Path to the file or directory. + // + // Paths are relative to the input; for example with Add("dir") the Name + // will be set to "dir/file" if you create that file, but if you use + // Add("/path/to/dir") it will be "/path/to/dir/file". + Name string + + // File operation that triggered the event. + Op Op } // Op describes a set of file operations. -- 2.50.1