Browse Source

travis: Test with Go 1.10 (#764)

* travis: Test with Go 1.10

* travis: check gofmt only with go1.10+
Julien Schmidt 7 years ago
parent
commit
bcaf977ec3
2 changed files with 12 additions and 4 deletions
  1. 5 4
      .travis.yml
  2. 7 0
      .travis/gofmt.sh

+ 5 - 4
.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:
@@ -87,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

+ 7 - 0
.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