From: Martin Tournoij Date: Fri, 29 Jul 2022 18:29:25 +0000 (+0200) Subject: Tweak comment regarding relative paths (#466) X-Git-Tag: v1.7.2~98 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=f0aceb2cb00fad2da4024e19b6af3a80f4cdf828;p=fsnotify.git Tweak comment regarding relative paths (#466) Clarify what "relative" means here. Fixes #362 --- 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.