Skip to content
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

Re-Enable unparam Linter #13278

Closed
3 tasks done
bflad opened this issue May 12, 2020 · 2 comments · Fixed by #13692
Closed
3 tasks done

Re-Enable unparam Linter #13278

bflad opened this issue May 12, 2020 · 2 comments · Fixed by #13692
Assignees
Labels
linter Pertains to changes to or issues with the various linters. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented May 12, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The unparam linter was originally enabled back in the gometalinter days, but it was not migrated during the switchover to golangci-lint. For historical context: we migrated in a hurry due to CI timeout issues, so not sure if it was due to performance, it not existing in the tool, or just an omission. This linter is great for catching coding errors and we should re-enable it!

For now, we should ignore always receives reports, which are noisy with some of our development practices.

Affected Resource(s)

To see the reports:

$ golangci-lint run --enable unparam --exclude 'always receives' --max-issues-per-linter 0 ./aws
aws/resource_aws_api_gateway_base_path_mapping_test.go:124:56: `testAccCheckAWSAPIGatewayBasePathExists` - `name` is unused (unparam)
func testAccCheckAWSAPIGatewayBasePathExists(n string, name string, res *apigateway.BasePathMapping) resource.TestCheckFunc {
                                                       ^
aws/resource_aws_athena_database.go:67:126: expandAthenaResultConfiguration - result 1 (error) is always nil (unparam)
func expandAthenaResultConfiguration(bucket string, encryptionConfigurationList []interface{}) (*athena.ResultConfiguration, error) {
                                                                                                                             ^
aws/resource_aws_cloudtrail_test.go:552:67: `testAccCheckCloudTrailLoggingEnabled` - `trail` is unused (unparam)
func testAccCheckCloudTrailLoggingEnabled(n string, desired bool, trail *cloudtrail.Trail) resource.TestCheckFunc {
                                                                  ^
aws/resource_aws_ecs_cluster_test.go:494:58: `testAccAWSEcsClusterCapacityProvidersFargate` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargate(rName, providerName string) string {
                                                         ^
aws/resource_aws_ecs_cluster_test.go:510:62: `testAccAWSEcsClusterCapacityProvidersFargateSpot` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateSpot(rName, providerName string) string {
                                                             ^
aws/resource_aws_ecs_cluster_test.go:526:62: `testAccAWSEcsClusterCapacityProvidersFargateBoth` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateBoth(rName, providerName string) string {
                                                             ^
aws/resource_aws_ecs_cluster_test.go:542:68: `testAccAWSEcsClusterCapacityProvidersFargateNoStrategy` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateNoStrategy(rName, providerName string) string {
                                                                   ^
aws/resource_aws_ecs_cluster_test.go:552:72: `testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy(rName, providerName string) string {
                                                                       ^
aws/resource_aws_ecs_task_definition.go:611:93: expandEcsInferenceAccelerators - result 1 (error) is always nil (unparam)
func expandEcsInferenceAccelerators(configured []interface{}) ([]*ecs.InferenceAccelerator, error) {
                                                                                            ^
aws/resource_aws_eip_association_test.go:233:61: `testAccCheckAWSEIPAssociationHasIpBasedId` - `res` is unused (unparam)
func testAccCheckAWSEIPAssociationHasIpBasedId(name string, res *ec2.Address) resource.TestCheckFunc {
                                                            ^
aws/resource_aws_inspector_resource_group_test.go:72:53: `testAccCheckAWSInspectorResourceGroupRecreated` - `t` is unused (unparam)
func testAccCheckAWSInspectorResourceGroupRecreated(t *testing.T, v1, v2 *inspector.ResourceGroup) resource.TestCheckFunc {
                                                    ^
aws/resource_aws_instance_migrate.go:79:56: writeV1BlockDevice - result 0 (error) is always nil (unparam)
	is *terraform.InstanceState, oldBd map[string]string) error {
	                                                      ^
aws/resource_aws_kinesis_analytics_application.go:1088:96: createApplicationUpdateOpts - result 1 (error) is always nil (unparam)
func createApplicationUpdateOpts(d *schema.ResourceData) (*kinesisanalytics.ApplicationUpdate, error) {
                                                                                               ^
aws/resource_aws_kinesis_video_stream_test.go:167:68: `testAccCheckKinesisVideoStreamDisappears` - `stream` is unused (unparam)
func testAccCheckKinesisVideoStreamDisappears(resourceName string, stream *kinesisvideo.StreamInfo) resource.TestCheckFunc {
                                                                   ^
aws/resource_aws_lambda_function_test.go:2375:56: `testAccAWSLambdaConfigWithDeadLetterConfigUpdated` - `funcName` is unused (unparam)
func testAccAWSLambdaConfigWithDeadLetterConfigUpdated(funcName, topic1Name, topic2Name, policyName,
                                                       ^
aws/resource_aws_lambda_permission_test.go:544:53: `testAccAWSLambdaPermissionDisappears` - `statement` is unused (unparam)
func testAccAWSLambdaPermissionDisappears(n string, statement *LambdaPolicyStatement) resource.TestCheckFunc {
                                                    ^
aws/resource_aws_lightsail_key_pair_test.go:178:63: `testAccAWSLightsailKeyPairConfig_imported` - `key` is unused (unparam)
func testAccAWSLightsailKeyPairConfig_imported(lightsailName, key string) string {
                                                              ^
aws/resource_aws_main_route_table_association_test.go:73:2: `testAccCheckMainRouteTableAssociation` - `routeTableResource` is unused (unparam)
	routeTableResource string) resource.TestCheckFunc {
	^
aws/resource_aws_network_acl_rule_test.go:343:52: `testAccCheckAWSNetworkAclRuleExists` - `networkAcl` is unused (unparam)
func testAccCheckAWSNetworkAclRuleExists(n string, networkAcl *ec2.NetworkAcl) resource.TestCheckFunc {
                                                   ^
aws/resource_aws_opsworks_instance.go:942:85: readOpsworksBlockDevices - result 1 (error) is always nil (unparam)
func readOpsworksBlockDevices(instance *opsworks.Instance) (map[string]interface{}, error) {
                                                                                    ^
aws/resource_aws_redshift_security_group.go:333:120: expandRedshiftSGAuthorizeIngress - result 1 (error) is always nil (unparam)
func expandRedshiftSGAuthorizeIngress(configured []interface{}) ([]redshift.AuthorizeClusterSecurityGroupIngressInput, error) {
                                                                                                                       ^
aws/resource_aws_redshift_security_group.go:361:114: expandRedshiftSGRevokeIngress - result 1 (error) is always nil (unparam)
func expandRedshiftSGRevokeIngress(configured []interface{}) ([]redshift.RevokeClusterSecurityGroupIngressInput, error) {
                                                                                                                 ^
aws/resource_aws_route53_record_migrate.go:29:94: migrateRoute53RecordStateV0toV1 - result 1 (error) is always nil (unparam)
func migrateRoute53RecordStateV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) {
                                                                                             ^
aws/resource_aws_security_group_rule.go:734:91: setFromIPPerm - result 0 (error) is always nil (unparam)
func setFromIPPerm(d *schema.ResourceData, sg *ec2.SecurityGroup, rule *ec2.IpPermission) error {
                                                                                          ^
aws/resource_aws_security_group_rule.go:975:88: populateSecurityGroupRuleFromImport - result 0 (error) is always nil (unparam)
func populateSecurityGroupRuleFromImport(d *schema.ResourceData, importParts []string) error {
                                                                                       ^
aws/resource_aws_ses_domain_dkim_test.go:102:51: `testAccCheckAwsSESDomainDkimTokens` - `domain` is unused (unparam)
func testAccCheckAwsSESDomainDkimTokens(n string, domain string) resource.TestCheckFunc {
                                                  ^
aws/resource_aws_ses_template_test.go:96:41: `testAccCheckSesTemplate` - `template` is unused (unparam)
func testAccCheckSesTemplate(pr string, template *ses.Template) resource.TestCheckFunc {
                                        ^
aws/resource_aws_spot_fleet_request.go:768:87: buildLaunchTemplateConfigs - result 1 (error) is always nil (unparam)
func buildLaunchTemplateConfigs(d *schema.ResourceData) ([]*ec2.LaunchTemplateConfig, error) {
                                                                                      ^
aws/resource_aws_subnet_test.go:336:44: `testAccCheckAwsSubnetIpv6BeforeUpdate` - `t` is unused (unparam)
func testAccCheckAwsSubnetIpv6BeforeUpdate(t *testing.T, subnet *ec2.Subnet) resource.TestCheckFunc {
                                           ^
aws/resource_aws_subnet_test.go:350:43: `testAccCheckAwsSubnetIpv6AfterUpdate` - `t` is unused (unparam)
func testAccCheckAwsSubnetIpv6AfterUpdate(t *testing.T, subnet *ec2.Subnet) resource.TestCheckFunc {
                                          ^
aws/resource_aws_volume_attachment_test.go:195:68: `testAccCheckVolumeAttachmentExists` - `v` is unused (unparam)
func testAccCheckVolumeAttachmentExists(n string, i *ec2.Instance, v *ec2.Volume) resource.TestCheckFunc {
                                                                   ^
aws/resource_aws_vpn_connection_route_test.go:104:2: `testAccAwsVpnConnectionRoute` - `vpnGatewayResource` is unused (unparam)
	vpnGatewayResource string,
	^
aws/resource_aws_vpn_connection_route_test.go:105:2: `testAccAwsVpnConnectionRoute` - `customerGatewayResource` is unused (unparam)
	customerGatewayResource string,
	^
aws/resource_aws_vpn_connection_route_test.go:106:2: `testAccAwsVpnConnectionRoute` - `vpnConnectionResource` is unused (unparam)
	vpnConnectionResource string,
	^
aws/resource_aws_wafregional_web_acl_association.go:127:65: resourceAwsWafRegionalWebAclAssociationParseId - result webAclId is never used (unparam)
func resourceAwsWafRegionalWebAclAssociationParseId(id string) (webAclId, resourceArn string) {
                                                                ^
aws/structure.go:103:65: expandEcsVolumes - result 1 (error) is always nil (unparam)
func expandEcsVolumes(configured []interface{}) ([]*ecs.Volume, error) {
                                                                ^
aws/structure.go:324:68: expandParameters - result 1 (error) is always nil (unparam)
func expandParameters(configured []interface{}) ([]*rds.Parameter, error) {
                                                                   ^
aws/structure.go:348:81: expandRedshiftParameters - result 1 (error) is always nil (unparam)
func expandRedshiftParameters(configured []interface{}) ([]*redshift.Parameter, error) {
                                                                                ^
aws/structure.go:373:75: expandDocDBParameters - result 1 (error) is always nil (unparam)
func expandDocDBParameters(configured []interface{}) ([]*docdb.Parameter, error) {
                                                                          ^
aws/structure.go:457:96: expandElastiCacheParameters - result 1 (error) is always nil (unparam)
func expandElastiCacheParameters(configured []interface{}) ([]*elasticache.ParameterNameValue, error) {
                                                                                               ^
aws/structure.go:478:79: expandNeptuneParameters - result 1 (error) is always nil (unparam)
func expandNeptuneParameters(configured []interface{}) ([]*neptune.Parameter, error) {
                                                                              ^
aws/structure.go:1902:131: expandApiGatewayMethodParametersOperations - result 1 (error) is always nil (unparam)
func expandApiGatewayMethodParametersOperations(d *schema.ResourceData, key string, prefix string) ([]*apigateway.PatchOperation, error) {
                                                                                                                                  ^
aws/structure.go:2109:80: expandPolicyAttributes - result 1 (error) is always nil (unparam)
func expandPolicyAttributes(configured []interface{}) ([]*elb.PolicyAttribute, error) {
                                                                               ^

Definition of Done

  • Config present in .golangci.yml:
issues:
  exclude-rules:
    # ...
    - linters:
        - unparam
      text: "always receives"
  • unparam reports fixed
  • unparam linter added in .golangci.yml

References

@bflad bflad added the technical-debt Addresses areas of the codebase that need refactoring or redesign. label May 12, 2020
bflad added a commit that referenced this issue May 12, 2020
Reference: #13278

Previously:

```
aws/resource_aws_api_gateway_base_path_mapping_test.go:124:56: `testAccCheckAWSAPIGatewayBasePathExists` - `name` is unused (unparam)
func testAccCheckAWSAPIGatewayBasePathExists(n string, name string, res *apigateway.BasePathMapping) resource.TestCheckFunc {
                                                       ^
aws/resource_aws_athena_database.go:67:126: expandAthenaResultConfiguration - result 1 (error) is always nil (unparam)
func expandAthenaResultConfiguration(bucket string, encryptionConfigurationList []interface{}) (*athena.ResultConfiguration, error) {
                                                                                                                             ^
aws/resource_aws_cloudtrail_test.go:552:67: `testAccCheckCloudTrailLoggingEnabled` - `trail` is unused (unparam)
func testAccCheckCloudTrailLoggingEnabled(n string, desired bool, trail *cloudtrail.Trail) resource.TestCheckFunc {
                                                                  ^
aws/resource_aws_ecs_cluster_test.go:494:58: `testAccAWSEcsClusterCapacityProvidersFargate` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargate(rName, providerName string) string {
                                                         ^
aws/resource_aws_ecs_cluster_test.go:510:62: `testAccAWSEcsClusterCapacityProvidersFargateSpot` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateSpot(rName, providerName string) string {
                                                             ^
aws/resource_aws_ecs_cluster_test.go:526:62: `testAccAWSEcsClusterCapacityProvidersFargateBoth` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateBoth(rName, providerName string) string {
                                                             ^
aws/resource_aws_ecs_cluster_test.go:542:68: `testAccAWSEcsClusterCapacityProvidersFargateNoStrategy` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateNoStrategy(rName, providerName string) string {
                                                                   ^
aws/resource_aws_ecs_cluster_test.go:552:72: `testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy(rName, providerName string) string {
                                                                       ^
aws/resource_aws_ecs_task_definition.go:611:93: expandEcsInferenceAccelerators - result 1 (error) is always nil (unparam)
func expandEcsInferenceAccelerators(configured []interface{}) ([]*ecs.InferenceAccelerator, error) {
                                                                                            ^
aws/resource_aws_eip_association_test.go:233:61: `testAccCheckAWSEIPAssociationHasIpBasedId` - `res` is unused (unparam)
func testAccCheckAWSEIPAssociationHasIpBasedId(name string, res *ec2.Address) resource.TestCheckFunc {
                                                            ^
aws/resource_aws_inspector_resource_group_test.go:72:53: `testAccCheckAWSInspectorResourceGroupRecreated` - `t` is unused (unparam)
func testAccCheckAWSInspectorResourceGroupRecreated(t *testing.T, v1, v2 *inspector.ResourceGroup) resource.TestCheckFunc {
                                                    ^
aws/resource_aws_instance_migrate.go:79:56: writeV1BlockDevice - result 0 (error) is always nil (unparam)
	is *terraform.InstanceState, oldBd map[string]string) error {
	                                                      ^
aws/resource_aws_kinesis_analytics_application.go:1088:96: createApplicationUpdateOpts - result 1 (error) is always nil (unparam)
func createApplicationUpdateOpts(d *schema.ResourceData) (*kinesisanalytics.ApplicationUpdate, error) {
                                                                                               ^
aws/resource_aws_kinesis_video_stream_test.go:167:68: `testAccCheckKinesisVideoStreamDisappears` - `stream` is unused (unparam)
func testAccCheckKinesisVideoStreamDisappears(resourceName string, stream *kinesisvideo.StreamInfo) resource.TestCheckFunc {
                                                                   ^
aws/resource_aws_lambda_function_test.go:2375:56: `testAccAWSLambdaConfigWithDeadLetterConfigUpdated` - `funcName` is unused (unparam)
func testAccAWSLambdaConfigWithDeadLetterConfigUpdated(funcName, topic1Name, topic2Name, policyName,
                                                       ^
aws/resource_aws_lambda_permission_test.go:544:53: `testAccAWSLambdaPermissionDisappears` - `statement` is unused (unparam)
func testAccAWSLambdaPermissionDisappears(n string, statement *LambdaPolicyStatement) resource.TestCheckFunc {
                                                    ^
aws/resource_aws_lightsail_key_pair_test.go:178:63: `testAccAWSLightsailKeyPairConfig_imported` - `key` is unused (unparam)
func testAccAWSLightsailKeyPairConfig_imported(lightsailName, key string) string {
                                                              ^
aws/resource_aws_main_route_table_association_test.go:73:2: `testAccCheckMainRouteTableAssociation` - `routeTableResource` is unused (unparam)
	routeTableResource string) resource.TestCheckFunc {
	^
```

Output from acceptance testing:

```
(TestAccAWSAPIGatewayBasePathMapping_|TestAccAWSAthenaDatabase_|TestAccAWSCloudTrail/Trail/enableLogging|TestAccAWSEcsCluster_CapacityProviders|TestAccAWSEcsTaskDefinition_|TestAccAWSInspectorResourceGroup_basic|TestAccAWSKinesisAnalyticsApplication_|TestAccAWSKinesisVideoStream_disappears|TestAccAWSLambdaFunction_DeadLetterConfigUpdated|TestAccAWSLambdaPermission_disappears|TestAccAWSLightsailKeyPair_publicKey|TestAccAWSMainRouteTableAssociation_basic)

--- PASS: TestAccAWSAPIGatewayBasePathMapping_BasePath_Empty (54.58s)
--- PASS: TestAccAWSAPIGatewayBasePathMapping_basic (55.48s)

--- PASS: TestAccAWSAthenaDatabase_basic (60.51s)
--- PASS: TestAccAWSAthenaDatabase_destroyFailsIfTablesExist (73.58s)
--- PASS: TestAccAWSAthenaDatabase_encryption (71.05s)
--- PASS: TestAccAWSAthenaDatabase_forceDestroyAlwaysSucceeds (65.41s)
--- PASS: TestAccAWSAthenaDatabase_nameCantHaveUppercase (1.46s)
--- PASS: TestAccAWSAthenaDatabase_nameStartsWithUnderscore (61.23s)

--- PASS: TestAccAWSCloudTrail/Trail/enableLogging (105.77s)

--- PASS: TestAccAWSEcsCluster_CapacityProviders (48.45s)
--- PASS: TestAccAWSEcsCluster_CapacityProvidersNoStrategy (53.69s)
--- PASS: TestAccAWSEcsCluster_CapacityProvidersUpdate (81.22s)

--- PASS: TestAccAWSEcsTaskDefinition_arrays (16.36s)
--- PASS: TestAccAWSEcsTaskDefinition_basic (26.60s)
--- PASS: TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource (26.89s)
--- PASS: TestAccAWSEcsTaskDefinition_constraint (16.28s)
--- PASS: TestAccAWSEcsTaskDefinition_ExecutionRole (16.69s)
--- PASS: TestAccAWSEcsTaskDefinition_Fargate (21.81s)
--- PASS: TestAccAWSEcsTaskDefinition_Inactive (25.92s)
--- PASS: TestAccAWSEcsTaskDefinition_inferenceAccelerator (14.07s)
--- PASS: TestAccAWSEcsTaskDefinition_ProxyConfiguration (26.41s)
--- PASS: TestAccAWSEcsTaskDefinition_Tags (45.91s)
--- PASS: TestAccAWSEcsTaskDefinition_withDockerVolume (16.00s)
--- PASS: TestAccAWSEcsTaskDefinition_withDockerVolumeMinimalConfig (16.27s)
--- PASS: TestAccAWSEcsTaskDefinition_withEcsService (91.23s)
--- PASS: TestAccAWSEcsTaskDefinition_withEFSVolume (27.55s)
--- PASS: TestAccAWSEcsTaskDefinition_withEFSVolumeMinimal (27.70s)
--- PASS: TestAccAWSEcsTaskDefinition_withIPCMode (16.69s)
--- PASS: TestAccAWSEcsTaskDefinition_withNetworkMode (16.85s)
--- PASS: TestAccAWSEcsTaskDefinition_withPidMode (18.24s)
--- PASS: TestAccAWSEcsTaskDefinition_withScratchVolume (15.69s)
--- PASS: TestAccAWSEcsTaskDefinition_withTaskRoleArn (16.75s)
--- PASS: TestAccAWSEcsTaskDefinition_withTaskScopedDockerVolume (16.38s)

--- PASS: TestAccAWSInspectorResourceGroup_basic (22.88s)

--- PASS: TestAccAWSKinesisAnalyticsApplication_addCloudwatchLoggingOptions (34.01s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_basic (18.73s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsAdd (75.84s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisFirehose (103.79s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisStream (63.12s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsUpdateKinesisStream (120.00s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Add (50.36s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Create (39.75s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsAdd (75.76s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsKinesisStream (62.71s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsMultiple (66.35s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsUpdateKinesisStream (123.03s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSource (38.35s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSourceUpdate (69.86s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_tags (49.91s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_update (28.74s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_updateCloudwatchLoggingOptions (46.64s)
--- PASS: TestAccAWSKinesisVideoStream_disappears (95.02s)

--- PASS: TestAccAWSLambdaFunction_DeadLetterConfigUpdated (76.72s)

--- PASS: TestAccAWSLambdaPermission_disappears (100.98s)

--- PASS: TestAccAWSLightsailKeyPair_publicKey (29.88s)

--- PASS: TestAccAWSMainRouteTableAssociation_basic (69.00s)
```
bflad added a commit that referenced this issue May 19, 2020
* provider: First batch of unparam linter fixes

Reference: #13278

Previously:

```
aws/resource_aws_api_gateway_base_path_mapping_test.go:124:56: `testAccCheckAWSAPIGatewayBasePathExists` - `name` is unused (unparam)
func testAccCheckAWSAPIGatewayBasePathExists(n string, name string, res *apigateway.BasePathMapping) resource.TestCheckFunc {
                                                       ^
aws/resource_aws_athena_database.go:67:126: expandAthenaResultConfiguration - result 1 (error) is always nil (unparam)
func expandAthenaResultConfiguration(bucket string, encryptionConfigurationList []interface{}) (*athena.ResultConfiguration, error) {
                                                                                                                             ^
aws/resource_aws_cloudtrail_test.go:552:67: `testAccCheckCloudTrailLoggingEnabled` - `trail` is unused (unparam)
func testAccCheckCloudTrailLoggingEnabled(n string, desired bool, trail *cloudtrail.Trail) resource.TestCheckFunc {
                                                                  ^
aws/resource_aws_ecs_cluster_test.go:494:58: `testAccAWSEcsClusterCapacityProvidersFargate` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargate(rName, providerName string) string {
                                                         ^
aws/resource_aws_ecs_cluster_test.go:510:62: `testAccAWSEcsClusterCapacityProvidersFargateSpot` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateSpot(rName, providerName string) string {
                                                             ^
aws/resource_aws_ecs_cluster_test.go:526:62: `testAccAWSEcsClusterCapacityProvidersFargateBoth` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateBoth(rName, providerName string) string {
                                                             ^
aws/resource_aws_ecs_cluster_test.go:542:68: `testAccAWSEcsClusterCapacityProvidersFargateNoStrategy` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateNoStrategy(rName, providerName string) string {
                                                                   ^
aws/resource_aws_ecs_cluster_test.go:552:72: `testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy(rName, providerName string) string {
                                                                       ^
aws/resource_aws_ecs_task_definition.go:611:93: expandEcsInferenceAccelerators - result 1 (error) is always nil (unparam)
func expandEcsInferenceAccelerators(configured []interface{}) ([]*ecs.InferenceAccelerator, error) {
                                                                                            ^
aws/resource_aws_eip_association_test.go:233:61: `testAccCheckAWSEIPAssociationHasIpBasedId` - `res` is unused (unparam)
func testAccCheckAWSEIPAssociationHasIpBasedId(name string, res *ec2.Address) resource.TestCheckFunc {
                                                            ^
aws/resource_aws_inspector_resource_group_test.go:72:53: `testAccCheckAWSInspectorResourceGroupRecreated` - `t` is unused (unparam)
func testAccCheckAWSInspectorResourceGroupRecreated(t *testing.T, v1, v2 *inspector.ResourceGroup) resource.TestCheckFunc {
                                                    ^
aws/resource_aws_instance_migrate.go:79:56: writeV1BlockDevice - result 0 (error) is always nil (unparam)
	is *terraform.InstanceState, oldBd map[string]string) error {
	                                                      ^
aws/resource_aws_kinesis_analytics_application.go:1088:96: createApplicationUpdateOpts - result 1 (error) is always nil (unparam)
func createApplicationUpdateOpts(d *schema.ResourceData) (*kinesisanalytics.ApplicationUpdate, error) {
                                                                                               ^
aws/resource_aws_kinesis_video_stream_test.go:167:68: `testAccCheckKinesisVideoStreamDisappears` - `stream` is unused (unparam)
func testAccCheckKinesisVideoStreamDisappears(resourceName string, stream *kinesisvideo.StreamInfo) resource.TestCheckFunc {
                                                                   ^
aws/resource_aws_lambda_function_test.go:2375:56: `testAccAWSLambdaConfigWithDeadLetterConfigUpdated` - `funcName` is unused (unparam)
func testAccAWSLambdaConfigWithDeadLetterConfigUpdated(funcName, topic1Name, topic2Name, policyName,
                                                       ^
aws/resource_aws_lambda_permission_test.go:544:53: `testAccAWSLambdaPermissionDisappears` - `statement` is unused (unparam)
func testAccAWSLambdaPermissionDisappears(n string, statement *LambdaPolicyStatement) resource.TestCheckFunc {
                                                    ^
aws/resource_aws_lightsail_key_pair_test.go:178:63: `testAccAWSLightsailKeyPairConfig_imported` - `key` is unused (unparam)
func testAccAWSLightsailKeyPairConfig_imported(lightsailName, key string) string {
                                                              ^
aws/resource_aws_main_route_table_association_test.go:73:2: `testAccCheckMainRouteTableAssociation` - `routeTableResource` is unused (unparam)
	routeTableResource string) resource.TestCheckFunc {
	^
```

Output from acceptance testing:

```
(TestAccAWSAPIGatewayBasePathMapping_|TestAccAWSAthenaDatabase_|TestAccAWSCloudTrail/Trail/enableLogging|TestAccAWSEcsCluster_CapacityProviders|TestAccAWSEcsTaskDefinition_|TestAccAWSInspectorResourceGroup_basic|TestAccAWSKinesisAnalyticsApplication_|TestAccAWSKinesisVideoStream_disappears|TestAccAWSLambdaFunction_DeadLetterConfigUpdated|TestAccAWSLambdaPermission_disappears|TestAccAWSLightsailKeyPair_publicKey|TestAccAWSMainRouteTableAssociation_basic)

--- PASS: TestAccAWSAPIGatewayBasePathMapping_BasePath_Empty (54.58s)
--- PASS: TestAccAWSAPIGatewayBasePathMapping_basic (55.48s)

--- PASS: TestAccAWSAthenaDatabase_basic (60.51s)
--- PASS: TestAccAWSAthenaDatabase_destroyFailsIfTablesExist (73.58s)
--- PASS: TestAccAWSAthenaDatabase_encryption (71.05s)
--- PASS: TestAccAWSAthenaDatabase_forceDestroyAlwaysSucceeds (65.41s)
--- PASS: TestAccAWSAthenaDatabase_nameCantHaveUppercase (1.46s)
--- PASS: TestAccAWSAthenaDatabase_nameStartsWithUnderscore (61.23s)

--- PASS: TestAccAWSCloudTrail/Trail/enableLogging (105.77s)

--- PASS: TestAccAWSEcsCluster_CapacityProviders (48.45s)
--- PASS: TestAccAWSEcsCluster_CapacityProvidersNoStrategy (53.69s)
--- PASS: TestAccAWSEcsCluster_CapacityProvidersUpdate (81.22s)

--- PASS: TestAccAWSEcsTaskDefinition_arrays (16.36s)
--- PASS: TestAccAWSEcsTaskDefinition_basic (26.60s)
--- PASS: TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource (26.89s)
--- PASS: TestAccAWSEcsTaskDefinition_constraint (16.28s)
--- PASS: TestAccAWSEcsTaskDefinition_ExecutionRole (16.69s)
--- PASS: TestAccAWSEcsTaskDefinition_Fargate (21.81s)
--- PASS: TestAccAWSEcsTaskDefinition_Inactive (25.92s)
--- PASS: TestAccAWSEcsTaskDefinition_inferenceAccelerator (14.07s)
--- PASS: TestAccAWSEcsTaskDefinition_ProxyConfiguration (26.41s)
--- PASS: TestAccAWSEcsTaskDefinition_Tags (45.91s)
--- PASS: TestAccAWSEcsTaskDefinition_withDockerVolume (16.00s)
--- PASS: TestAccAWSEcsTaskDefinition_withDockerVolumeMinimalConfig (16.27s)
--- PASS: TestAccAWSEcsTaskDefinition_withEcsService (91.23s)
--- PASS: TestAccAWSEcsTaskDefinition_withEFSVolume (27.55s)
--- PASS: TestAccAWSEcsTaskDefinition_withEFSVolumeMinimal (27.70s)
--- PASS: TestAccAWSEcsTaskDefinition_withIPCMode (16.69s)
--- PASS: TestAccAWSEcsTaskDefinition_withNetworkMode (16.85s)
--- PASS: TestAccAWSEcsTaskDefinition_withPidMode (18.24s)
--- PASS: TestAccAWSEcsTaskDefinition_withScratchVolume (15.69s)
--- PASS: TestAccAWSEcsTaskDefinition_withTaskRoleArn (16.75s)
--- PASS: TestAccAWSEcsTaskDefinition_withTaskScopedDockerVolume (16.38s)

--- PASS: TestAccAWSInspectorResourceGroup_basic (22.88s)

--- PASS: TestAccAWSKinesisAnalyticsApplication_addCloudwatchLoggingOptions (34.01s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_basic (18.73s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsAdd (75.84s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisFirehose (103.79s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisStream (63.12s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsUpdateKinesisStream (120.00s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Add (50.36s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Create (39.75s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsAdd (75.76s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsKinesisStream (62.71s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsMultiple (66.35s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsUpdateKinesisStream (123.03s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSource (38.35s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSourceUpdate (69.86s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_tags (49.91s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_update (28.74s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_updateCloudwatchLoggingOptions (46.64s)
--- PASS: TestAccAWSKinesisVideoStream_disappears (95.02s)

--- PASS: TestAccAWSLambdaFunction_DeadLetterConfigUpdated (76.72s)

--- PASS: TestAccAWSLambdaPermission_disappears (100.98s)

--- PASS: TestAccAWSLightsailKeyPair_publicKey (29.88s)

--- PASS: TestAccAWSMainRouteTableAssociation_basic (69.00s)
```

* resource/aws_instance: Remove redundant return

Previously:

```
aws/resource_aws_instance_migrate.go:108:2: S1023: redundant `return` statement (gosimple)
	return
	^
```
adamdecaf pushed a commit to adamdecaf/terraform-provider-aws that referenced this issue May 28, 2020
* provider: First batch of unparam linter fixes

Reference: hashicorp#13278

Previously:

```
aws/resource_aws_api_gateway_base_path_mapping_test.go:124:56: `testAccCheckAWSAPIGatewayBasePathExists` - `name` is unused (unparam)
func testAccCheckAWSAPIGatewayBasePathExists(n string, name string, res *apigateway.BasePathMapping) resource.TestCheckFunc {
                                                       ^
aws/resource_aws_athena_database.go:67:126: expandAthenaResultConfiguration - result 1 (error) is always nil (unparam)
func expandAthenaResultConfiguration(bucket string, encryptionConfigurationList []interface{}) (*athena.ResultConfiguration, error) {
                                                                                                                             ^
aws/resource_aws_cloudtrail_test.go:552:67: `testAccCheckCloudTrailLoggingEnabled` - `trail` is unused (unparam)
func testAccCheckCloudTrailLoggingEnabled(n string, desired bool, trail *cloudtrail.Trail) resource.TestCheckFunc {
                                                                  ^
aws/resource_aws_ecs_cluster_test.go:494:58: `testAccAWSEcsClusterCapacityProvidersFargate` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargate(rName, providerName string) string {
                                                         ^
aws/resource_aws_ecs_cluster_test.go:510:62: `testAccAWSEcsClusterCapacityProvidersFargateSpot` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateSpot(rName, providerName string) string {
                                                             ^
aws/resource_aws_ecs_cluster_test.go:526:62: `testAccAWSEcsClusterCapacityProvidersFargateBoth` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateBoth(rName, providerName string) string {
                                                             ^
aws/resource_aws_ecs_cluster_test.go:542:68: `testAccAWSEcsClusterCapacityProvidersFargateNoStrategy` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateNoStrategy(rName, providerName string) string {
                                                                   ^
aws/resource_aws_ecs_cluster_test.go:552:72: `testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy` - `providerName` is unused (unparam)
func testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy(rName, providerName string) string {
                                                                       ^
aws/resource_aws_ecs_task_definition.go:611:93: expandEcsInferenceAccelerators - result 1 (error) is always nil (unparam)
func expandEcsInferenceAccelerators(configured []interface{}) ([]*ecs.InferenceAccelerator, error) {
                                                                                            ^
aws/resource_aws_eip_association_test.go:233:61: `testAccCheckAWSEIPAssociationHasIpBasedId` - `res` is unused (unparam)
func testAccCheckAWSEIPAssociationHasIpBasedId(name string, res *ec2.Address) resource.TestCheckFunc {
                                                            ^
aws/resource_aws_inspector_resource_group_test.go:72:53: `testAccCheckAWSInspectorResourceGroupRecreated` - `t` is unused (unparam)
func testAccCheckAWSInspectorResourceGroupRecreated(t *testing.T, v1, v2 *inspector.ResourceGroup) resource.TestCheckFunc {
                                                    ^
aws/resource_aws_instance_migrate.go:79:56: writeV1BlockDevice - result 0 (error) is always nil (unparam)
	is *terraform.InstanceState, oldBd map[string]string) error {
	                                                      ^
aws/resource_aws_kinesis_analytics_application.go:1088:96: createApplicationUpdateOpts - result 1 (error) is always nil (unparam)
func createApplicationUpdateOpts(d *schema.ResourceData) (*kinesisanalytics.ApplicationUpdate, error) {
                                                                                               ^
aws/resource_aws_kinesis_video_stream_test.go:167:68: `testAccCheckKinesisVideoStreamDisappears` - `stream` is unused (unparam)
func testAccCheckKinesisVideoStreamDisappears(resourceName string, stream *kinesisvideo.StreamInfo) resource.TestCheckFunc {
                                                                   ^
aws/resource_aws_lambda_function_test.go:2375:56: `testAccAWSLambdaConfigWithDeadLetterConfigUpdated` - `funcName` is unused (unparam)
func testAccAWSLambdaConfigWithDeadLetterConfigUpdated(funcName, topic1Name, topic2Name, policyName,
                                                       ^
aws/resource_aws_lambda_permission_test.go:544:53: `testAccAWSLambdaPermissionDisappears` - `statement` is unused (unparam)
func testAccAWSLambdaPermissionDisappears(n string, statement *LambdaPolicyStatement) resource.TestCheckFunc {
                                                    ^
aws/resource_aws_lightsail_key_pair_test.go:178:63: `testAccAWSLightsailKeyPairConfig_imported` - `key` is unused (unparam)
func testAccAWSLightsailKeyPairConfig_imported(lightsailName, key string) string {
                                                              ^
aws/resource_aws_main_route_table_association_test.go:73:2: `testAccCheckMainRouteTableAssociation` - `routeTableResource` is unused (unparam)
	routeTableResource string) resource.TestCheckFunc {
	^
```

Output from acceptance testing:

```
(TestAccAWSAPIGatewayBasePathMapping_|TestAccAWSAthenaDatabase_|TestAccAWSCloudTrail/Trail/enableLogging|TestAccAWSEcsCluster_CapacityProviders|TestAccAWSEcsTaskDefinition_|TestAccAWSInspectorResourceGroup_basic|TestAccAWSKinesisAnalyticsApplication_|TestAccAWSKinesisVideoStream_disappears|TestAccAWSLambdaFunction_DeadLetterConfigUpdated|TestAccAWSLambdaPermission_disappears|TestAccAWSLightsailKeyPair_publicKey|TestAccAWSMainRouteTableAssociation_basic)

--- PASS: TestAccAWSAPIGatewayBasePathMapping_BasePath_Empty (54.58s)
--- PASS: TestAccAWSAPIGatewayBasePathMapping_basic (55.48s)

--- PASS: TestAccAWSAthenaDatabase_basic (60.51s)
--- PASS: TestAccAWSAthenaDatabase_destroyFailsIfTablesExist (73.58s)
--- PASS: TestAccAWSAthenaDatabase_encryption (71.05s)
--- PASS: TestAccAWSAthenaDatabase_forceDestroyAlwaysSucceeds (65.41s)
--- PASS: TestAccAWSAthenaDatabase_nameCantHaveUppercase (1.46s)
--- PASS: TestAccAWSAthenaDatabase_nameStartsWithUnderscore (61.23s)

--- PASS: TestAccAWSCloudTrail/Trail/enableLogging (105.77s)

--- PASS: TestAccAWSEcsCluster_CapacityProviders (48.45s)
--- PASS: TestAccAWSEcsCluster_CapacityProvidersNoStrategy (53.69s)
--- PASS: TestAccAWSEcsCluster_CapacityProvidersUpdate (81.22s)

--- PASS: TestAccAWSEcsTaskDefinition_arrays (16.36s)
--- PASS: TestAccAWSEcsTaskDefinition_basic (26.60s)
--- PASS: TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource (26.89s)
--- PASS: TestAccAWSEcsTaskDefinition_constraint (16.28s)
--- PASS: TestAccAWSEcsTaskDefinition_ExecutionRole (16.69s)
--- PASS: TestAccAWSEcsTaskDefinition_Fargate (21.81s)
--- PASS: TestAccAWSEcsTaskDefinition_Inactive (25.92s)
--- PASS: TestAccAWSEcsTaskDefinition_inferenceAccelerator (14.07s)
--- PASS: TestAccAWSEcsTaskDefinition_ProxyConfiguration (26.41s)
--- PASS: TestAccAWSEcsTaskDefinition_Tags (45.91s)
--- PASS: TestAccAWSEcsTaskDefinition_withDockerVolume (16.00s)
--- PASS: TestAccAWSEcsTaskDefinition_withDockerVolumeMinimalConfig (16.27s)
--- PASS: TestAccAWSEcsTaskDefinition_withEcsService (91.23s)
--- PASS: TestAccAWSEcsTaskDefinition_withEFSVolume (27.55s)
--- PASS: TestAccAWSEcsTaskDefinition_withEFSVolumeMinimal (27.70s)
--- PASS: TestAccAWSEcsTaskDefinition_withIPCMode (16.69s)
--- PASS: TestAccAWSEcsTaskDefinition_withNetworkMode (16.85s)
--- PASS: TestAccAWSEcsTaskDefinition_withPidMode (18.24s)
--- PASS: TestAccAWSEcsTaskDefinition_withScratchVolume (15.69s)
--- PASS: TestAccAWSEcsTaskDefinition_withTaskRoleArn (16.75s)
--- PASS: TestAccAWSEcsTaskDefinition_withTaskScopedDockerVolume (16.38s)

--- PASS: TestAccAWSInspectorResourceGroup_basic (22.88s)

--- PASS: TestAccAWSKinesisAnalyticsApplication_addCloudwatchLoggingOptions (34.01s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_basic (18.73s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsAdd (75.84s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisFirehose (103.79s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisStream (63.12s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsUpdateKinesisStream (120.00s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Add (50.36s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Create (39.75s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsAdd (75.76s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsKinesisStream (62.71s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsMultiple (66.35s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsUpdateKinesisStream (123.03s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSource (38.35s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSourceUpdate (69.86s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_tags (49.91s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_update (28.74s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_updateCloudwatchLoggingOptions (46.64s)
--- PASS: TestAccAWSKinesisVideoStream_disappears (95.02s)

--- PASS: TestAccAWSLambdaFunction_DeadLetterConfigUpdated (76.72s)

--- PASS: TestAccAWSLambdaPermission_disappears (100.98s)

--- PASS: TestAccAWSLightsailKeyPair_publicKey (29.88s)

--- PASS: TestAccAWSMainRouteTableAssociation_basic (69.00s)
```

* resource/aws_instance: Remove redundant return

Previously:

```
aws/resource_aws_instance_migrate.go:108:2: S1023: redundant `return` statement (gosimple)
	return
	^
```
@anGie44 anGie44 self-assigned this Jun 8, 2020
This was referenced Jun 8, 2020
@anGie44 anGie44 added this to the v2.67.0 milestone Jun 17, 2020
@ghost
Copy link

ghost commented Jun 19, 2020

This has been released in version 2.67.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Jul 18, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 18, 2020
@breathingdust breathingdust added the linter Pertains to changes to or issues with the various linters. label Oct 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linter Pertains to changes to or issues with the various linters. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants