Make most of the Go code comply with gofmt (except enums).

Enums are not fixed because depending on they have comments or not they
will be aligned alogn the asssignment character.
This commit is contained in:
gonzaloserrano
2016-07-07 12:55:36 +02:00
parent 73d5bf46b4
commit ec20233fab
8 changed files with 262 additions and 126 deletions

View File

@@ -29,9 +29,9 @@ mkdir -p ${go_src}/MyGame/Example
mkdir -p ${go_src}/github.com/google/flatbuffers/go
mkdir -p ${go_src}/flatbuffers_test
cp -u MyGame/Example/*.go ./go_gen/src/MyGame/Example/
cp -u ../go/* ./go_gen/src/github.com/google/flatbuffers/go
cp -u ./go_test.go ./go_gen/src/flatbuffers_test/
cp -a MyGame/Example/*.go ./go_gen/src/MyGame/Example/
cp -a ../go/* ./go_gen/src/github.com/google/flatbuffers/go
cp -a ./go_test.go ./go_gen/src/flatbuffers_test/
# Run tests with necessary flags.
# Developers may wish to see more detail by appending the verbosity flag
@@ -50,6 +50,18 @@ GOPATH=${go_path} go test flatbuffers_test \
--fuzz_fields=4 \
--fuzz_objects=10000
GO_TEST_RESULT=$?
rm -rf ${go_path}/{pkg,src}
if [[ $GO_TEST_RESULT == 0 ]]; then
echo "OK: Go tests passed."
else
echo "KO: Go tests failed."
exit 1
fi
echo "OK: Go tests passed."
NOT_FMT_FILES=$(gofmt -l MyGame)
if [[ ${NOT_FMT_FILES} != "" ]]; then
echo "These files are not well gofmt'ed:\n\n${NOT_FMT_FILES}"
# enable this when enums are properly formated
# exit 1
fi