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

Add support for Go 1.16 #1818

Merged
merged 1 commit into from Feb 27, 2021
Merged

Add support for Go 1.16 #1818

merged 1 commit into from Feb 27, 2021

Conversation

rafikdraoui
Copy link
Contributor

Go 1.16 changes the way modules are handled. It now expects Go projects to have non-empty go.mod files.

This change is compatible with Go 1.15.

Fixes #1815


The golang tests pass under all combinations of Go [1.15|1.16] + GO111MODULE=[""|"on"|"auto"].

I could also install and run the following hook successfully with both Go 1.15 and Go 1.16:

- repo: local
    hooks:
      - id: shfmt
        name: Format shell files with shfmt
        language: golang
        additional_dependencies: ["mvdan.cc/sh/v3/cmd/shfmt@v3.2.1"]
        types: [shell]
        entry: shfmt -w

These changes work for my use cases, and they seem sensible to me, but I'm not all that familiar with Go modules, so perhaps this has some implications I don't know about.

Go 1.16 changes the way modules are handled. It now expects Go projects
to have non-empty `go.mod` files.

This change is compatible with Go 1.15.

Fixes #1815
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

validated that this is the only reasonable fix -- even setting the remote properly does not convince go that it should build

@asottile asottile merged commit a38f8d0 into pre-commit:master Feb 27, 2021
@rafikdraoui rafikdraoui deleted the go1.16-support branch February 27, 2021 15:10
This was referenced Mar 8, 2021
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Go 1.16
2 participants