Help us shape the future of Go! Take the 2026 Go Developer Survey

watch

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(changed []string) error

Handler receives the set of changed file paths after debouncing.

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher watches a directory tree for relevant file changes.

func New

func New(dir string, exts []string, handler Handler) (*Watcher, error)

New creates a Watcher rooted at dir, watching files with the given extensions.

func (*Watcher) Run

func (w *Watcher) Run(stop <-chan struct{}) error

Run starts the watch loop until stop is closed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL