Merge pull request #1047 from PiotrSikora/go_vet

integration: Fix issues reported by the `go vet` tool.
This commit is contained in:
Tatsuhiro Tsujikawa 2017-11-03 23:02:37 +09:00 committed by GitHub
commit 6f7e94cdba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -211,7 +211,7 @@ func TestH1H1GracefulShutdown(t *testing.T) {
want := io.EOF want := io.EOF
b := make([]byte, 256) b := make([]byte, 256)
if _, err := st.conn.Read(b); err == nil || err != want { if _, err := st.conn.Read(b); err == nil || err != want {
t.Errorf("st.conn.Read(): %v; want %v, %v", err, want) t.Errorf("st.conn.Read(): %v; want %v", err, want)
} }
} }

View File

@ -1204,10 +1204,10 @@ func TestH2H1ProxyProtocolV1TCP6(t *testing.T) {
func TestH2H1ProxyProtocolV1Unknown(t *testing.T) { func TestH2H1ProxyProtocolV1Unknown(t *testing.T) {
st := newServerTester([]string{"--accept-proxy-protocol", "--add-x-forwarded-for", "--add-forwarded=for", "--forwarded-for=ip"}, t, func(w http.ResponseWriter, r *http.Request) { st := newServerTester([]string{"--accept-proxy-protocol", "--add-x-forwarded-for", "--add-forwarded=for", "--forwarded-for=ip"}, t, func(w http.ResponseWriter, r *http.Request) {
if got, notWant := r.Header.Get("X-Forwarded-For"), "192.168.0.2"; got == notWant { if got, notWant := r.Header.Get("X-Forwarded-For"), "192.168.0.2"; got == notWant {
t.Errorf("X-Forwarded-For: %v") t.Errorf("X-Forwarded-For: %v; want something else", got)
} }
if got, notWant := r.Header.Get("Forwarded"), "for=192.168.0.2"; got == notWant { if got, notWant := r.Header.Get("Forwarded"), "for=192.168.0.2"; got == notWant {
t.Errorf("Forwarded: %v") t.Errorf("Forwarded: %v; want something else", got)
} }
}) })
defer st.Close() defer st.Close()