Skip to content

prevent unused variable error #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

jaypipes
Copy link
Collaborator

A previous commit that changed the ACK pkg/resource templates
introduced an error for controllers that have CREATE or UPDATE
implementations where the Output shape from the operation sets no fields
on the CR.

In these cases, attempting to build these controllers was resulting in a
build failure, like this for the RDS controller:

pkg/resource/db_parameter_group/sdk.go:205:6: resp declared but not used

This corrects that by using a blanking technique immediately after the
variable declaration:

var resp *SomeSDKShape; _ = resp;

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

A [previous commit][0] that changed the ACK pkg/resource templates
introduced an error for controllers that have CREATE or UPDATE
implementations where the Output shape from the operation sets no fields
on the CR.

In these cases, attempting to build these controllers was resulting in a
build failure, like this for the RDS controller:

```
pkg/resource/db_parameter_group/sdk.go:205:6: resp declared but not used
```

This corrects that by using a blanking technique immediately after the
variable declaration:

```
var resp *SomeSDKShape; _ = resp;
```

[0]: a42b4a1
@jaypipes jaypipes requested a review from a-hilaly June 22, 2021 20:32
jaypipes added a commit to jaypipes/ack-rds-controller that referenced this pull request Jun 23, 2021
Regenerates the RDS controller to get to ACK runtime v0.2.3 and the new
logging changes.

Includes the changes from aws-controllers-k8s/code-generator#101
ack-bot pushed a commit to aws-controllers-k8s/rds-controller that referenced this pull request Jun 23, 2021
Regenerates the RDS controller to get to ACK runtime v0.2.3 and the new
logging changes.

Includes the changes from aws-controllers-k8s/code-generator#101

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice trick!

@a-hilaly
Copy link
Member

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 23, 2021
@ack-bot
Copy link
Collaborator

ack-bot commented Jun 23, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, jaypipes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit 2e9866d into aws-controllers-k8s:main Jun 23, 2021
RedbackThomson pushed a commit to RedbackThomson/ack-code-generator that referenced this pull request Jun 24, 2021
A [previous commit][0] that changed the ACK pkg/resource templates
introduced an error for controllers that have CREATE or UPDATE
implementations where the Output shape from the operation sets no fields
on the CR.

In these cases, attempting to build these controllers was resulting in a
build failure, like this for the RDS controller:

```
pkg/resource/db_parameter_group/sdk.go:205:6: resp declared but not used
```

This corrects that by using a blanking technique immediately after the
variable declaration:

```
var resp *SomeSDKShape; _ = resp;
```

[0]: a42b4a1

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants