Skip to content

Commit

Permalink
Remove unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
savitaashture authored and tekton-robot committed Apr 3, 2020
1 parent 1ae22fd commit 14fbd97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/sink/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (r Sink) HandleEvent(response http.ResponseWriter, request *http.Request) {
}

//The eventlistener waits until all the trigger executions (up-to the creation of the resources) and
//only when at least one of the execution completed successfully, it returns response code 201(Accepted) otherwise it returns 202 (Created).
//only when at least one of the execution completed successfully, it returns response code 201(Created) otherwise it returns 202 (Accepted).
code := http.StatusAccepted
for i := 0; i < len(el.Spec.Triggers); i++ {
thiscode := <-result
Expand Down Expand Up @@ -144,7 +144,7 @@ func (r Sink) processTrigger(t *triggersv1.EventListenerTrigger, request *http.R
}
log := eventLog.With(zap.String(triggersv1.TriggerLabelKey, t.Name))

finalPayload, header, err := r.executeInterceptors(t, request, event, eventID, log)
finalPayload, header, err := r.executeInterceptors(t, request, event, log)
if err != nil {
log.Error(err)
return err
Expand Down Expand Up @@ -178,7 +178,7 @@ func (r Sink) processTrigger(t *triggersv1.EventListenerTrigger, request *http.R
return nil
}

func (r Sink) executeInterceptors(t *triggersv1.EventListenerTrigger, in *http.Request, event []byte, eventID string, log *zap.SugaredLogger) ([]byte, http.Header, error) {
func (r Sink) executeInterceptors(t *triggersv1.EventListenerTrigger, in *http.Request, event []byte, log *zap.SugaredLogger) ([]byte, http.Header, error) {
if len(t.Interceptors) == 0 {
return event, in.Header, nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/sink/sink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ func TestExecuteInterceptor(t *testing.T) {
if err != nil {
t.Fatalf("http.NewRequest: %v", err)
}
resp, header, err := r.executeInterceptors(trigger, req, []byte(`{}`), "", logger)
resp, header, err := r.executeInterceptors(trigger, req, []byte(`{}`), logger)
if err != nil {
t.Fatalf("executeInterceptors: %v", err)
}
Expand Down Expand Up @@ -671,7 +671,7 @@ func TestExecuteInterceptor_error(t *testing.T) {
if err != nil {
t.Fatalf("http.NewRequest: %v", err)
}
if resp, _, err := s.executeInterceptors(trigger, req, nil, "", logger); err == nil {
if resp, _, err := s.executeInterceptors(trigger, req, nil, logger); err == nil {
t.Errorf("expected error, got: %+v, %v", string(resp), err)
}

Expand Down

0 comments on commit 14fbd97

Please sign in to comment.