fmt fixed

This commit is contained in:
alessio 2016-12-19 00:43:18 +01:00
parent e18815df46
commit 51db4b6ccc
1 changed files with 1 additions and 1 deletions

View File

@ -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}