type responseWriter … func newResponseWriter() *responseWriter { … } func (r *responseWriter) Header() http.Header { … } func (r *responseWriter) WriteHeader(code int) { … } func (r *responseWriter) Write([]byte) (int, error) { … } func TestHandshake(t *testing.T) { … } func TestIsUpgradeFailureError(t *testing.T) { … } func TestIsHTTPSProxyError(t *testing.T) { … }