add travis config

This commit is contained in:
Michael Stapelberg 2018-06-08 17:19:37 +02:00
parent 274a55e6d8
commit 94313e7b39
1 changed files with 18 additions and 0 deletions

18
.travis.yml Normal file
View File

@ -0,0 +1,18 @@
# Use the (faster) container-based infrastructure, see also
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false
dist: trusty
services:
- docker
language: go
go:
- "1.10"
script:
# Check whether files are syntactically correct.
- "gofmt -l $(find . -name '*.go' | tr '\\n' ' ') >/dev/null"
# Check whether files were not gofmt'ed.
- "gosrc=$(find . -name '*.go' | tr '\\n' ' '); [ $(gofmt -l $gosrc 2>&- | wc -l) -eq 0 ] || (echo 'gofmt was not run on these files:'; gofmt -l $gosrc 2>&-; false)"
- go tool vet .
- go test ./...