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 wastedassign linter finds wasted assignment statements. This typically represents a stylistic coding issue and fixing reports will increase code readability. This linter is similar to ifeffassign, but catches different reports. It is supported in golangci-lint.
Affected Resource(s)
aws/data_source_aws_s3_bucket_object.go:220:3: reassigned, but reassigned without using the value (wastedassign)
contentType := ""
^
aws/data_source_aws_sagemaker_prebuilt_ecr_image.go:343:2: reassigned, but reassigned without using the value (wastedassign)
id := ""
^
aws/resource_aws_autoscaling_group_waiting.go:79:2: reassigned, but reassigned without using the value (wastedassign)
recentStatus := ""
^
aws/resource_aws_dx_gateway_association.go:124:2: reassigned, but reassigned without using the value (wastedassign)
associationId := ""
^
aws/resource_aws_ebs_volume.go:235:5: reassigned, but never used afterwards (wastedassign)
resp = nil
^
aws/resource_aws_efs_file_system.go:145:2: reassigned, but reassigned without using the value (wastedassign)
creationToken := ""
^
aws/resource_aws_opsworks_permission.go:85:2: reassigned, but reassigned without using the value (wastedassign)
id := ""
^
aws/resource_aws_opsworks_rds_db_instance.go:109:2: reassigned, but reassigned without using the value (wastedassign)
id := ""
^
Definition of Done
Existing reports fixed and verified via golangci-lint --max-issues-per-linter 0 --enable wastedassign run ./aws
Community Note
Description
The
wastedassign
linter finds wasted assignment statements. This typically represents a stylistic coding issue and fixing reports will increase code readability. This linter is similar toifeffassign
, but catches different reports. It is supported ingolangci-lint
.Affected Resource(s)
Definition of Done
golangci-lint --max-issues-per-linter 0 --enable wastedassign run ./aws
wastedassign
added to.golangci.yml
and CI passes