Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools: depends on non-go-team library #56266

Closed
aldas opened this issue Oct 17, 2022 · 2 comments
Closed

x/tools: depends on non-go-team library #56266

aldas opened this issue Oct 17, 2022 · 2 comments
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@aldas
Copy link

aldas commented Oct 17, 2022

x/tools depends on github.com/yuin/goldmark library which is unlike all other dependencies owned by non-go team. Is not this potentially problematic or even unsafe for the community?

I see this because golang.org/x/net depends on golang.org/x/text it depends on golang.org/x/tools and now goldmark end up in your go.sum

https://github.com/golang/tools/blob/9b5e55b1a7e215a54c9784492d801104a8381a91/go.mod#L6

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Oct 17, 2022
@gopherbot gopherbot added this to the Unreleased milestone Oct 17, 2022
@rsc
Copy link
Contributor

rsc commented Oct 17, 2022

The use of goldmark is limited to the 'present' package and tool (as well as x/website for go.dev itself), so there is no safety problem for the vast majority of uses. In particular, if you are only using x/net or x/text, then you are not importing goldmark in any way. The long term plan is to remove the use of goldmark, which is only an implementation detail of those packages.

That said, if you are seeing goldmark in your go.sum file, I think that means your go.mod file says "go 1.16" or earlier and is not using pruned module graphs. If so, then as documented in the release notes I linked, you can run 'go mod tidy -go=1.17' (or 1.18 or 1.19) to update your go.mod file without affecting selected dependency versions.

If your go.mod already says 'go 1.17' or later, then you may just need to run 'go mod tidy' to clean up go.sum.

@seankhliao
Copy link
Member

Closing as this is known and intentional.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2022
@golang golang locked and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants