|
@@ -50,6 +50,7 @@ func restart(cmd *exec.Cmd) *exec.Cmd {
|
50
|
50
|
|
51
|
51
|
func initializeWatcher(shouldRestart chan bool, dirList []string) {
|
52
|
52
|
|
|
53
|
+ supportedExtensions := map[string]int{".go": 1, ".html": 1, ".tmpl": 1}
|
53
|
54
|
watcher, err := fsnotify.NewWatcher()
|
54
|
55
|
if err != nil {
|
55
|
56
|
log.Fatal(err)
|
|
@@ -63,7 +64,7 @@ func initializeWatcher(shouldRestart chan bool, dirList []string) {
|
63
|
64
|
case event := <-watcher.Events:
|
64
|
65
|
|
65
|
66
|
if event.Op == fsnotify.Write || event.Op == fsnotify.Rename {
|
66
|
|
- if filepath.Ext(event.Name) == ".go" {
|
|
67
|
+ if _, ok := supportedExtensions[filepath.Ext(event.Name)]; ok {
|
67
|
68
|
shouldRestart <- true
|
68
|
69
|
}
|
69
|
70
|
}
|