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

is this linter compatible with Go 1.20+ ? #58

Closed
atc0005 opened this issue Mar 22, 2023 · 6 comments · Fixed by #59
Closed

is this linter compatible with Go 1.20+ ? #58

atc0005 opened this issue Mar 22, 2023 · 6 comments · Fixed by #59

Comments

@atc0005
Copy link
Contributor

atc0005 commented Mar 22, 2023

@odeke-em

I enabled this linter in a Go 1.19 Docker image (golang:1.19.7) without issue, but for a Go 1.20 image (golang:1.20.2) I get this error:

structslop: internal error: package "errors" without types was imported from "github.com/..."

To reproduce:

  1. docker image pull golang:1.20.2
  2. docker container run -it --rm golang:1.20.2
  3. git clone https://github.com/atc0005/check-whois
  4. cd check-whois
  5. go install github.com/orijtech/structslop/cmd/structslop@v0.0.7
    • same result as go install github.com/orijtech/structslop/cmd/structslop@latest , but noting specific version for clarity
  6. structslop ./...

Output:

root@6c4091e45d1e:/go/check-whois# structslop ./...
structslop: internal error: package "errors" without types was imported from "github.com/atc0005/check-whois/internal/domain"

This produces no errors and no output:

  1. docker image pull golang:1.19.7
  2. docker container run -it --rm golang:1.19.7
  3. git clone https://github.com/atc0005/check-whois
  4. cd check-whois
  5. go install github.com/orijtech/structslop/cmd/structslop@v0.0.7
  6. structslop ./...
@tarnowsc
Copy link

tarnowsc commented Apr 7, 2023

seems that simple update of dependencies solves the issue:

module github.com/orijtech/structslop

go 1.18

require (
	github.com/dave/dst v0.27.2
	golang.org/x/tools v0.8.0
)

require (
	golang.org/x/mod v0.10.0 // indirect
	golang.org/x/sys v0.7.0 // indirect
)

@atc0005
Copy link
Contributor Author

atc0005 commented Apr 12, 2023

@tarnowsc Thanks for the feedback.

@odeke-em Will you accept a PR that provides these dependency updates?

@kirbyquerby
Copy link

We'll accept a PR (sorry for not actively responding to this issue). #54 is a good example of which files need to be changed.

atc0005 added a commit to atc0005/structslop that referenced this issue Apr 13, 2023
- update go.mod from 1.18 to 1.20 (optional)
- update Go version used in CI from 1.18.x to 1.20.x (optional)
- update dependencies (required)
  - `dave/dst`
    - `v0.27.0` to `v0.27.2`
  - `golang.org/x/tools`
    - `v0.1.11` to `v0.8.0`

refs orijtechGH-58
atc0005 added a commit to atc0005/structslop that referenced this issue Apr 13, 2023
- update go.mod from 1.18 to 1.20 (optional)
- update minimum supported Go version listed in README
- update Go version used in CI from 1.18.x to 1.20.x (optional)
- update dependencies (required)
  - `dave/dst`
    - `v0.27.0` to `v0.27.2`
  - `golang.org/x/tools`
    - `v0.1.11` to `v0.8.0`

refs orijtechGH-58
@atc0005
Copy link
Contributor Author

atc0005 commented Apr 13, 2023

@kirbyquerby

Submitted PR #59 for review.

kirbyquerby pushed a commit that referenced this issue Apr 14, 2023
* Update dependencies to support Go 1.20

- update go.mod from 1.18 to 1.20 (optional)
- update minimum supported Go version listed in README
- update Go version used in CI from 1.18.x to 1.20.x (optional)
- update dependencies (required)
  - `dave/dst`
    - `v0.27.0` to `v0.27.2`
  - `golang.org/x/tools`
    - `v0.1.11` to `v0.8.0`

refs GH-58

* Fix SA1019 io/ioutil deprecation linter error

---------

Co-authored-by: Adam Chalkley <atc0005@users.noreply.github.com>
@kirbyquerby
Copy link

Thanks @atc0005 for the PR updating to Go 1.20. I've created https://github.com/orijtech/structslop/releases/tag/v0.0.8 which should hopefully work. Feel free to reopen if there are still issues.

@atc0005
Copy link
Contributor Author

atc0005 commented Apr 14, 2023

@kirbyquerby Thanks!

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 a pull request may close this issue.

3 participants