gopy: add go vet test

This commit is contained in:
Sebastien Binet 2017-08-09 22:35:44 +02:00
parent 98d59f0c89
commit b2daa0909e
1 changed files with 11 additions and 0 deletions

View File

@ -15,6 +15,17 @@ import (
"testing"
)
func TestGovet(t *testing.T) {
cmd := exec.Command("go", "vet", "./...")
buf := new(bytes.Buffer)
cmd.Stdout = buf
cmd.Stderr = buf
err := cmd.Run()
if err != nil {
t.Fatalf("error running %s:\n%s\n%v", "go vet", string(buf.Bytes()), err)
}
}
func TestGofmt(t *testing.T) {
exe, err := exec.LookPath("goimports")
if err != nil {