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

Remove the goimport check #100

Merged
merged 3 commits into from
Dec 28, 2022
Merged

Remove the goimport check #100

merged 3 commits into from
Dec 28, 2022

Conversation

greed42
Copy link
Contributor

@greed42 greed42 commented Dec 28, 2022

For starters, the name is Check formatting and it does not check formatting. It checks imports.

But: The tool itself cannot cope with the golang.org/x/tools package: if you add the checksum it says via go mod download it then complains you need to go mod tidy, which then removes that checksum.

go: downloading golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a
go: updates to go.mod needed; to update it:
	go mod tidy

vs

missing go.sum entry for module providing package golang.org/x/tools/cmd/goimports; to add:
	go mod download golang.org/x/tools

For starters, the name is `Check formatting` and it does not check formatting. It checks imports.

But: The tool itself cannot cope with the `golang.org/x/tools` package: if you add the checksum it says via `go mod download` it then complains you need to `go mod tidy`, which then removes that checksum.

```
go: downloading golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a
go: updates to go.mod needed; to update it:
	go mod tidy
```
vs
```
missing go.sum entry for module providing package golang.org/x/tools/cmd/goimports; to add:
	go mod download golang.org/x/tools
```
```
greed42 added a commit that referenced this pull request Dec 28, 2022
It just makes more things mad. PR #100 to turn off the checker since it can't cope.
<https://cs.opensource.google/go/x/tools/+/master:cmd/goimports/goimports.go> actually also does gofmt. So that's not obvious from the name....

But we can't even use it in `--format-only` mode, it still whines about the go.sum entry that it then wants you to go mod tidy away. So just use gofmt.
@eswdd
Copy link
Contributor

eswdd commented Dec 28, 2022

Lgtm, but also check failures

@greed42 greed42 merged commit 6d87871 into master Dec 28, 2022
@greed42 greed42 deleted the remove-goimport-check branch December 28, 2022 16:47
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.

None yet

2 participants