travis: Stop using pcg and instead add neat checks
pcg is outdated.
The new checks are more useful.
Fix an ignored variable detected by ineffassign.
Bump to 1.9.7, since golang.org/x/tools is not compatible with 1.8.
Do not run go vet on 1.9.7, since -vettool is not available there.
diff --git a/.travis.yml b/.travis.yml
index 14cef95..b3d557e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,11 +6,16 @@
language: go
go:
-- 1.8.x
+- 1.9.7
- 1.x
-before_install:
- - go get github.com/maruel/pre-commit-go/cmd/pcg
+before_script:
+ - go get -u -v github.com/client9/misspell/cmd/misspell github.com/gordonklaus/ineffassign golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
script:
- - pcg
+ - echo 'Check Code is well formatted'; ! gofmt -s -d . | read
+ - echo 'Erroring on misspelling'; ! misspell . | grep a
+ - ineffassign .
+ - if [[ $TRAVIS_GO_VERSION != 1.9.7 ]]; then go vet -vettool=$GOPATH/bin/shadow ./...; fi
+ - go test -cover ./...
+ - go test -race ./...
diff --git a/utiltest.go b/utiltest.go
index 0485395..05f9643 100644
--- a/utiltest.go
+++ b/utiltest.go
@@ -276,7 +276,9 @@
if chunk != 0 {
_, err = l.State.Write(data[:chunk])
}
- _, err = l.State.Write([]byte("..."))
+ if err == nil {
+ _, err = l.State.Write([]byte("..."))
+ }
l.size = l.limit + 1
} else {
_, err = l.State.Write(data)