Skip to content

Conversation

@Madrigal
Copy link
Contributor

@Madrigal Madrigal commented Sep 9, 2025

Issue #, if available:

Description of changes:
Famously, Go fails to compile if a variable is declared but not used.

While testing, I noticed that when generating code for Smithy's endpoint rule engine, if you declare a variable as required but don't actually use it, the generated code fails to compile.

This is because we always generate an intermediate variable for required parameters, and if unused, we fail to compile.

This change generates an intermediate throwaway to make the compiler happy, but breaking my heart.

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

@Madrigal Madrigal requested review from a team as code owners September 9, 2025 19:20
@Madrigal Madrigal merged commit 5ef2d96 into main Sep 9, 2025
15 checks passed
@Madrigal Madrigal deleted the fix-allow-unused-required-param-endpoint branch September 9, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants