// newWebhookHandler returns a handler which receives webhook events and decodes the // request body. The caller passes a callback which is called on each webhook POST. // The object passed to cb is of the same type as list. func newWebhookHandler(t *testing.T, list runtime.Object, cb func(events runtime.Object)) http.Handler { … } type testWebhookHandler … func (t *testWebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { … } func newWebhook(t *testing.T, endpoint string, groupVersion schema.GroupVersion) *backend { … } func TestWebhook(t *testing.T) { … }