Skip to content

chore: future-proof min and max function names#1014

Closed
sgap wants to merge 1 commit intohashicorp:mainfrom
sgap:future-proof-min-max-func-names
Closed

chore: future-proof min and max function names#1014
sgap wants to merge 1 commit intohashicorp:mainfrom
sgap:future-proof-min-max-func-names

Conversation

@sgap
Copy link
Copy Markdown
Contributor

@sgap sgap commented Dec 3, 2024

Description

Starting with go 1.21 the built-in function names min and max will conflict with variables of the same name.

This PR will update variable names from min to minimum and max to maximum.

This PR will future-proof code from the error that will be thrown by gocritic about the shadowing of predeclared identifiers.

Testing plan

External links

New min and max built-in functions

Output from tests

@sgap sgap requested a review from a team as a code owner December 3, 2024 18:55
@ctrombley ctrombley force-pushed the future-proof-min-max-func-names branch from 63d9833 to ce10af6 Compare February 25, 2025 23:05
Copy link
Copy Markdown
Collaborator

@ctrombley ctrombley left a comment

Choose a reason for hiding this comment

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

Appreciate this!

@ctrombley ctrombley added the no-changelog-needed check changelog entry github workflow label Feb 25, 2025
@ctrombley ctrombley force-pushed the future-proof-min-max-func-names branch from ce10af6 to 8822f23 Compare February 25, 2025 23:59
@ctrombley
Copy link
Copy Markdown
Collaborator

Superseded by #1068.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed check changelog entry github workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants