Skip to content

bump to go1.19#54

Merged
onyxraven merged 4 commits intomasterfrom
go1.19
Oct 13, 2022
Merged

bump to go1.19#54
onyxraven merged 4 commits intomasterfrom
go1.19

Conversation

@onyxraven
Copy link
Member

@onyxraven onyxraven commented Oct 4, 2022

Background

Bump to latest things.

  1. to run golangci-lint in 1.19, had to upgrade past 1.48 -

  2. this introduced some new lints

    oswrap/exec.go:16: File is not `goimports`-ed (goimports)
    //todo use oswrap.Instance() instead of package local ow?
    oswrap/os.go:4:2: SA1019: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
    

Versioning

Patch release

type execWrap struct{}

//todo use oswrap.Instance() instead of package local ow?
// todo use oswrap.Instance() instead of package local ow?
Copy link
Member Author

Choose a reason for hiding this comment

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

linter complaint ;)

return ioutil.TempFile("/tmp", "TestRunCommandStdoutToFile")
return os.CreateTemp(t.TempDir(), "TestRunCommandStdoutToFile")
})
defer os.Remove("/tmp/TestRunCommandStdoutToFile")
Copy link
Member Author

Choose a reason for hiding this comment

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

adding to the t.TempDir means it gets cleaned up by the test framework. No more weird remove (which I'm unsure actually worked)

}
func (ow osWrap) WriteFile(filename string, data []byte, perm os.FileMode) error {
return ioutil.WriteFile(filename, data, perm)
return os.WriteFile(filename, data, perm)
Copy link
Member Author

Choose a reason for hiding this comment

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

nice that these just worked.

kr3cj
kr3cj previously approved these changes Oct 11, 2022
require (
github.com/golang/mock v1.6.0
github.com/mozilla-services/yaml v0.0.0-20201007153854-c369669a6625
github.com/spf13/cobra v1.2.1
Copy link
Member Author

Choose a reason for hiding this comment

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

this update reduced the dependency list for this package so much! yay!

github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't use this one, we use the mozilla one above. this is an indirect/transient from cobra

@onyxraven onyxraven requested a review from kr3cj October 11, 2022 20:55
@onyxraven
Copy link
Member Author

tested by hand too.

@onyxraven onyxraven merged commit 0d0ebf3 into master Oct 13, 2022
@onyxraven onyxraven deleted the go1.19 branch October 13, 2022 15:17
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.

2 participants