Skip to content

support running tools with go tool#182

Open
nvx wants to merge 2 commits intoalta:mainfrom
nvx:go-tool
Open

support running tools with go tool#182
nvx wants to merge 2 commits intoalta:mainfrom
nvx:go-tool

Conversation

@nvx
Copy link

@nvx nvx commented Feb 28, 2025

This implements the feature requested in #181

@nvx
Copy link
Author

nvx commented May 28, 2025

Is there anything holding th is up from being merged @ydnar?

Copy link
Contributor

@ydnar ydnar left a comment

Choose a reason for hiding this comment

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

Thanks! Can you add an end to end test, ensuring this is tested in dev and CI?

@nvx
Copy link
Author

nvx commented May 28, 2025

Thanks! Can you add an end to end test, ensuring this is tested in dev and CI?

I can do this, but to test that we'd need to add protoc-gen-go as a tool in the go.mod file, which in turn requires go 1.24. If you're happy with that I can bump those versions too and remove older Go versions from the CI workflows.

@ydnar
Copy link
Contributor

ydnar commented May 28, 2025

Given that 100% of the users of this tool will have that installed, I think we can assume its presence.

I don't think we need to bump Go version to 1.24 to achieve this.

@nvx
Copy link
Author

nvx commented May 29, 2025

I don't think we need to bump Go version to 1.24 to achieve this.

To use go tool <toolname> the tool needs to be listed in the go.mod file under the new tool directive which was only added in go1.24. Likewise the go tool command itself only exists in go1.24, so any earlier versions of go would fail the test.

The application itself can be built on older versions as it's just running the command, but the go module that it runs in when tool is enabled must be 1.24 or newer.

The only other option would be to make a separate module just for testing that only runs on go1.24 and not earlier versions but that'd likely make sense as an entirely separate workflow which seems a bit overkill.

@nvx
Copy link
Author

nvx commented Aug 19, 2025

Thoughts on my last comment @ydnar? I wasn't able to find a way to make a test work without the module being go1.24 or newer as that's when the go tool pattern functionality was introduced.

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.

2 participants