From 8a60d2ebf8e2dd66779f01ee7513f40fa98d6c79 Mon Sep 17 00:00:00 2001 From: Navid Shaikh Date: Tue, 7 Apr 2020 02:56:59 +0530 Subject: [PATCH] Remove unused variables and unreachable code (#779) --- pkg/eventing/v1alpha1/client.go | 4 ++-- pkg/kn/commands/describe.go | 1 - pkg/sources/v1alpha2/binding_client.go | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/eventing/v1alpha1/client.go b/pkg/eventing/v1alpha1/client.go index 16037fe7de..d77f2d522c 100644 --- a/pkg/eventing/v1alpha1/client.go +++ b/pkg/eventing/v1alpha1/client.go @@ -62,7 +62,7 @@ func NewKnEventingClient(client client_v1alpha1.EventingV1alpha1Interface, names //CreateTrigger is used to create an instance of trigger func (c *knEventingClient) CreateTrigger(trigger *v1alpha1.Trigger) error { - trigger, err := c.client.Triggers(c.namespace).Create(trigger) + _, err := c.client.Triggers(c.namespace).Create(trigger) if err != nil { return kn_errors.GetError(err) } @@ -112,7 +112,7 @@ func (c *knEventingClient) ListTriggers() (*v1alpha1.TriggerList, error) { //CreateTrigger is used to create an instance of trigger func (c *knEventingClient) UpdateTrigger(trigger *v1alpha1.Trigger) error { - trigger, err := c.client.Triggers(c.namespace).Update(trigger) + _, err := c.client.Triggers(c.namespace).Update(trigger) if err != nil { return kn_errors.GetError(err) } diff --git a/pkg/kn/commands/describe.go b/pkg/kn/commands/describe.go index 476cf724ca..28aee7ace3 100644 --- a/pkg/kn/commands/describe.go +++ b/pkg/kn/commands/describe.go @@ -158,7 +158,6 @@ func sortConditions(conditions []apis.Condition) []apis.Condition { default: return false } - return false }) return ret } diff --git a/pkg/sources/v1alpha2/binding_client.go b/pkg/sources/v1alpha2/binding_client.go index 406c0cad68..d004246fd0 100644 --- a/pkg/sources/v1alpha2/binding_client.go +++ b/pkg/sources/v1alpha2/binding_client.go @@ -66,7 +66,7 @@ func newKnSinkBindingClient(client clientv1alpha2.SinkBindingInterface, namespac //CreateSinkBinding is used to create an instance of binding func (c *knBindingClient) CreateSinkBinding(binding *v1alpha2.SinkBinding) error { - binding, err := c.client.Create(binding) + _, err := c.client.Create(binding) if err != nil { return knerrors.GetError(err) } @@ -116,7 +116,7 @@ func (c *knBindingClient) ListSinkBindings() (*v1alpha2.SinkBindingList, error) //CreateSinkBinding is used to create an instance of binding func (c *knBindingClient) UpdateSinkBinding(binding *v1alpha2.SinkBinding) error { - binding, err := c.client.Update(binding) + _, err := c.client.Update(binding) if err != nil { return knerrors.GetError(err) }