3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-29 23:49:25 +01:00

Merge pull request #257 from slingamn/issue253

have travis enforce gofmt, #253
This commit is contained in:
Daniel Oaks 2018-04-23 12:24:58 +10:00 committed by GitHub
commit 78c0825e2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 - tar -xzf goreleaser_Linux_x86_64.tar.gz -C $GOPATH/bin
- make - make
- make test - make test
- bash ./.travis.gofmt.sh

View File

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