From 23005ff0de93dfb49de4bf56dc20156977e58fc6 Mon Sep 17 00:00:00 2001 From: Julien Schmidt Date: Sat, 3 Mar 2018 18:16:26 +0100 Subject: [PATCH 1/2] travis: Test with Go 1.10 --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e922f9187..af0fa2955 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ go: - 1.7.x - 1.8.x - 1.9.x + - 1.10.x - master before_install: @@ -21,7 +22,7 @@ matrix: - env: DB=MYSQL57 sudo: required dist: trusty - go: 1.9.x + go: 1.10.x services: - docker before_install: @@ -43,7 +44,7 @@ matrix: - env: DB=MARIA55 sudo: required dist: trusty - go: 1.9.x + go: 1.10.x services: - docker before_install: @@ -65,7 +66,7 @@ matrix: - env: DB=MARIA10_1 sudo: required dist: trusty - go: 1.9.x + go: 1.10.x services: - docker before_install: From 270827d1461852d7eabb18f89d1fef403111e5b0 Mon Sep 17 00:00:00 2001 From: Julien Schmidt Date: Thu, 8 Mar 2018 12:44:38 +0800 Subject: [PATCH 2/2] travis: check gofmt only with go1.10+ --- .travis.yml | 2 +- .travis/gofmt.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 .travis/gofmt.sh diff --git a/.travis.yml b/.travis.yml index af0fa2955..4e60b0801 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,6 +88,6 @@ matrix: script: - go test -v -covermode=count -coverprofile=coverage.out - go vet ./... - - test -z "$(gofmt -d -s . | tee /dev/stderr)" + - .travis/gofmt.sh after_script: - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci diff --git a/.travis/gofmt.sh b/.travis/gofmt.sh new file mode 100755 index 000000000..9bf0d1684 --- /dev/null +++ b/.travis/gofmt.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -ev + +# Only check for go1.10+ since the gofmt style changed +if [[ $(go version) =~ go1\.([0-9]+) ]] && ((${BASH_REMATCH[1]} >= 10)); then + test -z "$(gofmt -d -s . | tee /dev/stderr)" +fi