feat(test): check format conditions in test

And add option '--fmt' in build script to gofmt files automatically.
Merge pull request #665 from unihorn/52

feat(test): check format conditions in test