go: remove unused parameters

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2023-03-20 11:03:36 +01:00
parent 822d7823f8
commit 0036b24266
106 changed files with 320 additions and 323 deletions

View file

@ -50,7 +50,7 @@ func newStubReaderClient(t *testing.T, objects []runtime.Object, getErr, listErr
}
}
func (c *stubReaderClient) Get(_ context.Context, key client.ObjectKey, out client.Object, opts ...client.GetOption) error {
func (c *stubReaderClient) Get(_ context.Context, key client.ObjectKey, out client.Object, _ ...client.GetOption) error {
gvks, _, err := c.scheme.ObjectKinds(out)
if err != nil {
panic(err)
@ -71,7 +71,7 @@ func (c *stubReaderClient) Get(_ context.Context, key client.ObjectKey, out clie
return c.getErr
}
func (c *stubReaderClient) List(_ context.Context, out client.ObjectList, opts ...client.ListOption) error {
func (c *stubReaderClient) List(_ context.Context, out client.ObjectList, _ ...client.ListOption) error {
gvks, _, err := c.scheme.ObjectKinds(out)
if err != nil {
panic(err)
@ -102,23 +102,23 @@ type stubWriterClient struct {
client.Client
}
func (c *stubWriterClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error {
func (c *stubWriterClient) Create(_ context.Context, _ client.Object, _ ...client.CreateOption) error {
return c.createErr
}
func (c *stubWriterClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error {
func (c *stubWriterClient) Delete(_ context.Context, _ client.Object, _ ...client.DeleteOption) error {
return c.deleteErr
}
func (c *stubWriterClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error {
func (c *stubWriterClient) Update(_ context.Context, _ client.Object, _ ...client.UpdateOption) error {
return c.updateErr
}
func (c *stubWriterClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error {
func (c *stubWriterClient) Patch(_ context.Context, _ client.Object, _ client.Patch, _ ...client.PatchOption) error {
return c.patchErr
}
func (c *stubWriterClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error {
func (c *stubWriterClient) DeleteAllOf(_ context.Context, _ client.Object, _ ...client.DeleteAllOfOption) error {
return c.deleteAllOfErr
}
@ -170,14 +170,14 @@ type stubStatusWriter struct {
patchErr error
}
func (w *stubStatusWriter) Create(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) error {
func (w *stubStatusWriter) Create(_ context.Context, _ client.Object, _ client.Object, _ ...client.SubResourceCreateOption) error {
return w.createErr
}
func (w *stubStatusWriter) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error {
func (w *stubStatusWriter) Update(_ context.Context, _ client.Object, _ ...client.SubResourceUpdateOption) error {
return w.updateErr
}
func (w *stubStatusWriter) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error {
func (w *stubStatusWriter) Patch(_ context.Context, _ client.Object, _ client.Patch, _ ...client.SubResourcePatchOption) error {
return w.patchErr
}

View file

@ -764,25 +764,25 @@ type stubNodeReplacer struct {
deleteErr error
}
func (r *stubNodeReplacer) GetNodeImage(ctx context.Context, providerID string) (string, error) {
func (r *stubNodeReplacer) GetNodeImage(_ context.Context, providerID string) (string, error) {
r.RLock()
defer r.RUnlock()
return r.nodeImages[providerID], r.nodeImageErr
}
func (r *stubNodeReplacer) GetScalingGroupID(ctx context.Context, providerID string) (string, error) {
func (r *stubNodeReplacer) GetScalingGroupID(_ context.Context, providerID string) (string, error) {
r.RLock()
defer r.RUnlock()
return r.scalingGroups[providerID], r.scalingGroupIDErr
}
func (r *stubNodeReplacer) CreateNode(ctx context.Context, scalingGroupID string) (nodeName, providerID string, err error) {
func (r *stubNodeReplacer) CreateNode(_ context.Context, _ string) (nodeName, providerID string, err error) {
r.RLock()
defer r.RUnlock()
return r.createNodeName, r.createProviderID, r.createErr
}
func (r *stubNodeReplacer) DeleteNode(ctx context.Context, providerID string) error {
func (r *stubNodeReplacer) DeleteNode(_ context.Context, _ string) error {
r.RLock()
defer r.RUnlock()
return r.deleteErr
@ -833,11 +833,11 @@ type stubNodeReplacerReader struct {
unimplementedNodeReplacer
}
func (r *stubNodeReplacerReader) GetNodeImage(ctx context.Context, providerID string) (string, error) {
func (r *stubNodeReplacerReader) GetNodeImage(_ context.Context, _ string) (string, error) {
return r.nodeImage, r.nodeImageErr
}
func (r *stubNodeReplacerReader) GetScalingGroupID(ctx context.Context, providerID string) (string, error) {
func (r *stubNodeReplacerReader) GetScalingGroupID(_ context.Context, _ string) (string, error) {
return r.scalingGroupID, r.scalingGroupIDErr
}
@ -853,30 +853,30 @@ type stubNodeReplacerWriter struct {
unimplementedNodeReplacer
}
func (r *stubNodeReplacerWriter) CreateNode(ctx context.Context, scalingGroupID string) (nodeName, providerID string, err error) {
func (r *stubNodeReplacerWriter) CreateNode(_ context.Context, scalingGroupID string) (nodeName, providerID string, err error) {
r.createCalls = append(r.createCalls, scalingGroupID)
return r.createNodeName, r.createProviderID, r.createErr
}
func (r *stubNodeReplacerWriter) DeleteNode(ctx context.Context, providerID string) error {
func (r *stubNodeReplacerWriter) DeleteNode(_ context.Context, providerID string) error {
r.deleteCalls = append(r.deleteCalls, providerID)
return r.deleteErr
}
type unimplementedNodeReplacer struct{}
func (*unimplementedNodeReplacer) GetNodeImage(ctx context.Context, providerID string) (string, error) {
func (*unimplementedNodeReplacer) GetNodeImage(_ context.Context, _ string) (string, error) {
panic("unimplemented")
}
func (*unimplementedNodeReplacer) GetScalingGroupID(ctx context.Context, providerID string) (string, error) {
func (*unimplementedNodeReplacer) GetScalingGroupID(_ context.Context, _ string) (string, error) {
panic("unimplemented")
}
func (*unimplementedNodeReplacer) CreateNode(ctx context.Context, scalingGroupID string) (nodeName, providerID string, err error) {
func (*unimplementedNodeReplacer) CreateNode(_ context.Context, _ string) (nodeName, providerID string, err error) {
panic("unimplemented")
}
func (*unimplementedNodeReplacer) DeleteNode(ctx context.Context, providerID string) error {
func (*unimplementedNodeReplacer) DeleteNode(_ context.Context, _ string) error {
panic("unimplemented")
}

View file

@ -236,13 +236,13 @@ type stubNodeStateGetter struct {
deleteNodeErr error
}
func (g *stubNodeStateGetter) GetNodeState(ctx context.Context, providerID string) (updatev1alpha1.CSPNodeState, error) {
func (g *stubNodeStateGetter) GetNodeState(_ context.Context, _ string) (updatev1alpha1.CSPNodeState, error) {
g.RLock()
defer g.RUnlock()
return g.nodeState, g.nodeStateErr
}
func (g *stubNodeStateGetter) DeleteNode(ctx context.Context, providerID string) error {
func (g *stubNodeStateGetter) DeleteNode(_ context.Context, _ string) error {
g.RLock()
defer g.RUnlock()
return g.deleteNodeErr

View file

@ -22,13 +22,13 @@ func newFakeScalingGroupUpdater() *fakeScalingGroupUpdater {
}
}
func (u *fakeScalingGroupUpdater) GetScalingGroupImage(ctx context.Context, scalingGroupID string) (string, error) {
func (u *fakeScalingGroupUpdater) GetScalingGroupImage(_ context.Context, scalingGroupID string) (string, error) {
u.RLock()
defer u.RUnlock()
return u.scalingGroupImage[scalingGroupID], nil
}
func (u *fakeScalingGroupUpdater) SetScalingGroupImage(ctx context.Context, scalingGroupID, imageURI string) error {
func (u *fakeScalingGroupUpdater) SetScalingGroupImage(_ context.Context, scalingGroupID, imageURI string) error {
u.Lock()
defer u.Unlock()
u.scalingGroupImage[scalingGroupID] = imageURI