feat(test): check format conditions in test

And add option '--fmt' in build script to gofmt files automatically.