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

go.mod toolchain error #134

Closed
ozkansen opened this issue Sep 7, 2023 · 6 comments
Closed

go.mod toolchain error #134

ozkansen opened this issue Sep 7, 2023 · 6 comments

Comments

@ozkansen
Copy link
Contributor

ozkansen commented Sep 7, 2023

Hi everyone, i got go 1.21 toolchain error.

go.mod file

module example

go 1.21

toolchain go1.21.0

error detail:

goimports-reviser -rm-unused -format ./...

output:

go.mod:5: unknown directive: toolchain
@james-d-elliott
Copy link

How do you get this directive into the go mod using the standard tooling? It doesn't appear it's a documented directive for go.mod, only for go.work.

@james-d-elliott
Copy link

Ah looks like go get toolchain adds it. Unusual for a lack of docs.

@ozkansen
Copy link
Contributor Author

ozkansen commented Sep 7, 2023

When I updated the base go version in the project with go mod tidy -go=1.21, it added it automatically.

@ozkansen
Copy link
Contributor Author

ozkansen commented Sep 7, 2023

The error appears to be caused by the golang.org/x/mod package. I made the necessary updates and the problem was fixed.

@incu6us
Copy link
Owner

incu6us commented Sep 8, 2023

thanks @ozkansen
could you fix issues in your PR to pass the pipeline?

incu6us added a commit that referenced this issue Sep 8, 2023
@incu6us
Copy link
Owner

incu6us commented Sep 8, 2023

thanks @ozkansen
now issue is fixed

@incu6us incu6us closed this as completed Sep 8, 2023
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

No branches or pull requests

3 participants