From 51db4b6ccc875bbea94f462159f099cc9e15d46b Mon Sep 17 00:00:00 2001 From: alessio Date: Mon, 19 Dec 2016 00:43:18 +0100 Subject: [PATCH] fmt fixed --- watcher/watcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watcher/watcher.go b/watcher/watcher.go index f678b33..4144ab9 100644 --- a/watcher/watcher.go +++ b/watcher/watcher.go @@ -143,7 +143,7 @@ func (p *Project) build() error { // Fmt calls an implementation of the "go fmt" func (p *Project) fmt(path string) error { - if p.Fmt { + if p.Fmt && strings.HasSuffix(path, ".go") { if stream, err := p.goTools(p.base, "gofmt", "-s", "-w", "-e", path); err != nil { msg := fmt.Sprintln(p.pname(p.Name, 2), ":", p.Red.Bold("Go Fmt"), p.Red.Regular("there are some errors in"), ":", p.Magenta.Bold(path)) out := BufferOut{Time: time.Now(), Text: "there are some errors in", Path: path, Type: "Go Fmt", Stream: stream}