MCPcopy Index your code
hub / github.com/php/frankenphp / Example

Function Example

watcher/watcher-go/watcher_test.go:14–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12)
13
14func Example() {
15 w := watcher.NewWatcher("/path/to/dir", func(e *watcher.Event) {
16 slog.Info("filesystem event", "event", e)
17 })
18 defer w.Close()
19
20 // Wait for a new line to exit
21 _, _ = fmt.Scanln()
22}
23
24func TestWatcher(t *testing.T) {
25 dir := t.TempDir()

Callers

nothing calls this directly

Calls 1

CloseMethod · 0.95

Tested by

no test coverage detected