Skip to content

Conversation

atc0005
Copy link
Contributor

@atc0005 atc0005 commented Apr 13, 2023

Changes

  • 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
  • fix SA1019 io/ioutil deprecation linter error

References

- 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
@kirbyquerby
Copy link

Thanks for the PR! Would you mind fixing the linting errors? It looks like golangci-lint just wants usages of ioutil to be replaced with io or os. These are the offending usages:

if err := ioutil.WriteFile(fn, content, st.Mode()); err != nil {

tmpdir, err := ioutil.TempDir(dir, "structslop-test-apply-")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmpdir)
fn := filepath.Join(tmpdir, "p.go")
src, _ := ioutil.ReadFile(filepath.Join(".", "testdata", "src", "struct", "p.go"))
if err := ioutil.WriteFile(fn, src, 0644); err != nil {
t.Fatal(err)
}
testdata := analysistest.TestData()
_ = structslop.Analyzer.Flags.Set("apply", "true")
defer func() {
_ = structslop.Analyzer.Flags.Set("apply", "false")
}()
analysistest.Run(t, testdata, structslop.Analyzer, filepath.Base(tmpdir))
got, _ := ioutil.ReadFile(fn)
expected, _ := ioutil.ReadFile(filepath.Join(".", "testdata", "src", "struct", "p.go.golden"))

@atc0005
Copy link
Contributor Author

atc0005 commented Apr 14, 2023

@kirbyquerby applied changes as requested.

The GHAW requires your approval before it can run/confirm the results.

Copy link

@kirbyquerby kirbyquerby left a comment

Choose a reason for hiding this comment

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

Nice work, thanks for the PR!

@kirbyquerby kirbyquerby merged commit 6fe7dca into orijtech:master Apr 14, 2023
@atc0005 atc0005 deleted the i58-update-dependencies-to-support-go-1.20 branch April 14, 2023 22:45
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.

is this linter compatible with Go 1.20+ ?

2 participants