3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-13 07:29:30 +01:00

have travis enforce gofmt, #253

This commit is contained in:
Shivaram Lingamneni 2018-04-22 20:36:50 -04:00
parent 8f22d5ffd8
commit 43b90f2a85
3 changed files with 13 additions and 2 deletions

10
.travis.gofmt.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# exclude vendor/
SOURCES="./oragono.go ./irc"
if [ -n "$(gofmt -s -l $SOURCES)" ]; then
echo "Go code is not formatted correctly with \`gofmt -s\`:"
gofmt -s -d $SOURCES
exit 1
fi

View File

@ -7,3 +7,4 @@ script:
- tar -xzf goreleaser_Linux_x86_64.tar.gz -C $GOPATH/bin
- make
- make test
- bash ./.travis.gofmt.sh

View File

@ -282,12 +282,12 @@ func schemaChangeV2ToV3(config *Config, tx *buntdb.Tx) error {
func init() {
allChanges := []SchemaChange{
SchemaChange{
{
InitialVersion: "1",
TargetVersion: "2",
Changer: schemaChangeV1toV2,
},
SchemaChange{
{
InitialVersion: "2",
TargetVersion: "3",
Changer: schemaChangeV2ToV3,