Skip to content

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

Merged
ctrombley merged 1 commit intomainfrom
future-proof-min-max-func-names
Feb 26, 2025
Merged

chore: future-proof min and max function names#1068
ctrombley merged 1 commit intomainfrom
future-proof-min-max-func-names

Conversation

@ctrombley
Copy link
Copy Markdown
Collaborator

@ctrombley ctrombley commented Feb 26, 2025

NOTE: This PR is a non-fork clone of #1014.

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

Thanks @sgap for the first-time contribution!

@ctrombley ctrombley self-assigned this Feb 26, 2025
@ctrombley ctrombley requested a review from a team as a code owner February 26, 2025 01:46
@ctrombley ctrombley added the no-changelog-needed check changelog entry github workflow label Feb 26, 2025
@datadog-terraform-cloud-hashicorp
Copy link
Copy Markdown

Datadog Report

Branch report: future-proof-min-max-func-names
Commit report: 7f4fa54
Test service: hashicorp/go-tfe

✅ 0 Failed, 1433 Passed, 164 Skipped, 21m 8.14s Total Time
➡️ Test Sessions change in coverage: 1 no change

@ctrombley ctrombley merged commit ab5f25e into main Feb 26, 2025
14 of 18 checks passed
@ctrombley ctrombley deleted the future-proof-min-max-func-names branch February 26, 2025 02:23
@github-actions
Copy link
Copy Markdown

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

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