From 90e8b84c8bf289d4a78987c02cdbd3fe4690beb7 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 22 Dec 2014 23:10:16 -0600 Subject: [PATCH] Update TravisCI to goclean script. - Also update to use the new container-based builds - Modify the tests slightly to make golint happy --- .travis.yml | 13 +++++++++---- internal_test.go | 10 ++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c038565..7e9d7381 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,17 @@ language: go go: - release - tip +sudo: false +before_install: + - gocleandeps=c16c849abae90c23419d + - git clone https://gist.github.com/$gocleandeps.git + - goclean=71d0380287747d956a26 + - git clone https://gist.github.com/$goclean.git install: - go get -d -t -v ./... - - go get -v golang.org/x/tools/cmd/cover + - bash $gocleandeps/gocleandeps.sh script: - - go test -v -covermode=count -coverprofile=profile.cov -after_success: - - go get -v github.com/mattn/goveralls - export PATH=$PATH:$HOME/gopath/bin + - bash $goclean/goclean.sh +after_success: - goveralls -coverprofile=profile.cov -service=travis-ci diff --git a/internal_test.go b/internal_test.go index 5663e05f..c53f1156 100644 --- a/internal_test.go +++ b/internal_test.go @@ -129,10 +129,16 @@ func TstWriteBlockHeader(w io.Writer, pver uint32, bh *BlockHeader) error { return writeBlockHeader(w, pver, bh) } +// TstMessageHeader is simply a redefinition of the internal messageHeader that +// is used to make golint happy since it rightly complains that it's typically +// not a good idea to return unexported types. +type TstMessageHeader messageHeader + // TstReadMessageHeader makes the internal readMessageHeader function available // to the test package. -func TstReadMessageHeader(r io.Reader) (int, *messageHeader, error) { - return readMessageHeader(r) +func TstReadMessageHeader(r io.Reader) (int, *TstMessageHeader, error) { + n, hdr, err := readMessageHeader(r) + return n, (*TstMessageHeader)(hdr), err } // TstReadOutPoint makes the internal readOutPoint function available to the