2
0
mirror of https://github.com/soheilhy/cmux.git synced 2024-11-10 11:41:52 +08:00

go tool vet --shadow .

This commit is contained in:
Tamir Duberstein 2016-02-03 23:49:21 -05:00
parent 4146b137dd
commit ebea4cb52a
2 changed files with 15 additions and 4 deletions

View File

@ -7,9 +7,12 @@ go:
before_install:
- go get -u github.com/golang/lint/golint
- if [[ $TRAVIS_GO_VERSION == 1.5* ]]; then go get -u github.com/kisielk/errcheck; fi
- go get -u golang.org/x/tools/cmd/vet
before_script:
- '! gofmt -s -l . | read'
- golint ./...
- echo $TRAVIS_GO_VERSION
- if [[ $TRAVIS_GO_VERSION == 1.5* ]]; then errcheck ./...; fi
- go vet .
- go tool vet --shadow .

View File

@ -46,9 +46,11 @@ func runTestHTTPServer(t *testing.T, l net.Listener) {
}
func runTestHTTP1Client(t *testing.T, addr string) {
r, err := http.Get("http://" + addr)
if err != nil {
var r *http.Response
if resp, err := http.Get("http://" + addr); err != nil {
t.Fatal(err)
} else {
r = resp
}
defer func() {
@ -124,9 +126,11 @@ func TestAny(t *testing.T) {
}
}()
r, err := http.Get("http://" + addr)
if err != nil {
var r *http.Response
if resp, err := http.Get("http://" + addr); err != nil {
t.Fatal(err)
} else {
r = resp
}
defer func() {
@ -135,6 +139,10 @@ func TestAny(t *testing.T) {
}
}()
b, err := ioutil.ReadAll(r.Body)
if err != nil {
t.Error(err)
}
if string(b) != testHTTP1Resp {
t.Errorf("invalid response: want=%s got=%s", testHTTP1Resp, b)
}