Skip to content

Remove toolchain#38

Merged
dhui merged 1 commit intodhui:masterfrom
SuperSandro2000:patch-1
Apr 17, 2025
Merged

Remove toolchain#38
dhui merged 1 commit intodhui:masterfrom
SuperSandro2000:patch-1

Conversation

@SuperSandro2000
Copy link
Contributor

With go 1.21 the controversial toolchain directive got introduced which forces downstream consumers of libraries to needlessly change their go compiler version with no way to ignore it on an application level without go mod tidy and various tools and linters silently failing. I am of the opinion that libraries shouldn't really set a toolchain to allow consumers to be not bothered by it.

@dhui
Copy link
Owner

dhui commented Sep 23, 2024

@SuperSandro2000 Thanks for the PR!

I believe that toolchain was added when I ran go get or go mod tidy so this directive will likely reappear after its been removed. How are you automatically preventing the toolchain directive from being re-added? Keeping this directive out of go.mod isn't something I want to manually manage.

I am of the opinion that libraries shouldn't really set a toolchain to allow consumers to be not bothered by it.

FWIW, I mostly agree. If the library doesn't have any such requirements, it shouldn't impose them. e.g. uses language/toolchain features in newer versions

@SuperSandro2000
Copy link
Contributor Author

There is currently no way to prevent this being re-added. We kinda fight against it all the time ourselves.

@dhui dhui merged commit 279d8ad into dhui:master Apr 17, 2025
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