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

devwatch

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package devwatch watches the files of a theme project that umono theme dev follows. It polls, so it needs no file system notifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnlyCSS

func OnlyCSS(paths []string) bool

OnlyCSS reports whether paths is just assets/theme.css: the page then swaps its stylesheet instead of reloading.

func Watch

func Watch(ctx context.Context, projectDir string, interval time.Duration, fn func(changed []string))

Watch scans projectDir every interval and calls fn with the changed paths, until ctx is done. A scan that fails is tried again at the next interval.

Types

type Snapshot

type Snapshot map[string]stamp

Snapshot is the stamp of theme.toml, attributes.toml and every file under assets/, by slash path. A missing file is left out.

func Scan

func Scan(projectDir string) (Snapshot, error)

Scan takes the snapshot of projectDir.

func (Snapshot) Changed

func (s Snapshot) Changed(old Snapshot) []string

Changed returns the paths whose file was added, removed or changed from old to s, sorted.

Jump to

Keyboard shortcuts

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