Skip to content

Conversation

@high-moctane
Copy link
Contributor

Thank you for this great linter!

This PR upgrades golang.org/x/tools to v0.31.0.

With the older version of golang.org/x/tools, an internal error occurs in Go 1.24.

When running wrapcheck with Go 1.24 using the following code:

package main

import _ "context"

func main() {}

the following internal error is reported:

wrapcheck: internal error: package "context" without types was imported from "github.com/high-moctane/example"

("github.com/high-moctane/example" is a placeholder package name.)

Additionally, since upgrading golang.org/x/tools to v0.31.0 makes it work only with Go 1.23.0 or later, I have updated README.md accordingly.

@tomarrell
Copy link
Owner

Hey @high-moctane, thanks for the contribution!

This is quite a bump, and limiting compatibility to Go >=1.23 is pretty significant. I'd aim to support at least a couple of minor versions back if we can get away with it.

Do you know if there's an earlier version of golang.org/x/tools which also support v1.24? If you still have your test repository up, maybe you could cycle through a few versions to see what works, unless there's some documentation existing.

@high-moctane
Copy link
Contributor Author

@tomarrell, thank you for your review!

It seems that v0.25.0 is the oldest version that works with go1.24.
I tested it on my local machine.

v0.25.0 is compatible with go version 1.22.0 or higher.
https://github.com/golang/tools/blob/v0.25.0/go.mod#L3

@tomarrell
Copy link
Owner

@high-moctane nice, then let's roll with that version. Compatibility with v1.22 is at least a couple of versions prior 👍

@high-moctane high-moctane changed the title deps: upgrade golang.org/x/tools to v0.31.0 deps: upgrade golang.org/x/tools to v0.25.0 Mar 11, 2025
@high-moctane
Copy link
Contributor Author

@tomarrell I have updated to v0.25.0. Could you review it again?

Copy link
Owner

@tomarrell tomarrell left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks a lot!

@tomarrell tomarrell merged commit 91a0edf into tomarrell:master Mar 11, 2025
1 check passed
@high-moctane high-moctane deleted the upgrade-deps branch March 11, 2025 15:09
@high-moctane
Copy link
Contributor Author

Thank you!

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