Skip to content

chore: remove legacy // +build syntax#220

Merged
nywilken merged 1 commit intomainfrom
chore/go-build-syntax
Jul 17, 2024
Merged

chore: remove legacy // +build syntax#220
nywilken merged 1 commit intomainfrom
chore/go-build-syntax

Conversation

@tenthirtyam
Copy link
Copy Markdown
Collaborator

Description

Removes the legacy // +build syntax.

The //go:build syntax was introduced in Go 1.17 to replace the older // +build syntax, offering a more readable and flexible way to specify build constraints.

For Go 1.17 and later:

  • Use the //go:build syntax for specifying build constraints.
  • The // +build syntax is still recognized for backward compatibility but is considered deprecated in new code.

For Go versions before 1.17:

  • Only the // +build syntax is recognized

Based on the version used in this project, the use of the following:

//go:build !windows
// +build !windows

... can be simplified to:

//go:build !windows

@tenthirtyam tenthirtyam added this to the v1.0.12 milestone Jul 7, 2024
@tenthirtyam tenthirtyam self-assigned this Jul 7, 2024
The `//go:build `syntax was introduced in Go 1.17 to replace the older `// +build` syntax, offering a more readable and flexible way to specify build constraints.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam tenthirtyam force-pushed the chore/go-build-syntax branch from 418631a to 49eae50 Compare July 7, 2024 03:18
@tenthirtyam tenthirtyam marked this pull request as ready for review July 7, 2024 03:19
@tenthirtyam tenthirtyam requested a review from a team as a code owner July 7, 2024 03:19
Copy link
Copy Markdown
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

LGTM - especially since all plugins require at least 1.21.0

@nywilken nywilken merged commit d00e38f into main Jul 17, 2024
@nywilken nywilken deleted the chore/go-build-syntax branch July 17, 2024 16:41
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 1, 2026

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

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

chore Chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants