]> go.fuhry.dev Git - fsnotify.git/commitdiff
Tweak comment regarding relative paths (#466)
authorMartin Tournoij <martin@arp242.net>
Fri, 29 Jul 2022 18:29:25 +0000 (20:29 +0200)
committerGitHub <noreply@github.com>
Fri, 29 Jul 2022 18:29:25 +0000 (20:29 +0200)
Clarify what "relative" means here.

Fixes #362

fsnotify.go

index 3fbc792900da2e4d45ac271cd7ae7b3e321a8175..6a305b5cb3b54b3a7bc46c4ab8af52d7be727647 100644 (file)
@@ -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.