diff --git a/.travis.yml b/.travis.yml
index 1b15e1763ee05082a1b2a823a69b72a2c397585f..d3ee1e8af9a820a51cfff38a38eac731810c0e50 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,7 @@ before_script:
   # - go test -race ./...
 script:
   - ./gocoverage.sh
+  - if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
 env:
   global:
     - PKG_CONFIG_PATH=/opt/qt54/lib/pkgconfig
diff --git a/gocoverage.sh b/gocoverage.sh
index f908a2d669b53dc78b233f914c807cd1b913cc64..5cb2fdf08dd958a4667abf22a02630e3b76e1fba 100755
--- a/gocoverage.sh
+++ b/gocoverage.sh
@@ -27,6 +27,3 @@ done
 
 $GOROOT/bin/go tool cover -func profile.cov
 
-# To submit the test coverage result to coveralls.io,
-# use goveralls (https://github.com/mattn/goveralls)
-goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN