Skip to content

go-zoox/watch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watcher

Make it create watcher easier.

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/watcher

Getting Started

import (
  "testing"
  "github.com/go-zoox/watcher"
)

func main(t *testing.T) {
	pwd, _ := os.Getwd()
	watcher := watcher.New(&watcher.Config{
		Context: path.Join(pwd, "example/program"),
		Ignores: []string{},
		Exts: []string{".go", ".mod", ".sum"},
		Commands: []string{
			"go run .",
		},
	})

	if err := watcher.Watch(); err != nil {
		logger.Error("failed to watch: %s", err)
	}
}

Inspired By

  • silenceper/gowatch - 🚀 gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file.
  • fsnotify/fsnotify - Cross-platform file system notifications for Go.

License

GoZoox is released under the MIT License.

About

Make it create watcher easier.

Resources

License

Stars

Watchers

Forks

Packages

No packages published