-
Notifications
You must be signed in to change notification settings - Fork 15
automate cleaning up deprecated io/ioutil #377
Conversation
|
||
# As of Go 1.19 io/ioutil is deprecated | ||
# We automate its upgrade here because it is quite a widely used package | ||
if [[ $TARGET_VERSION == "1.18" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if
is always true, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. I wanted to make it clear that we can remove it in time for the next upgrade but I guess a comment might be more fitting for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably shouldn't remove it. If any of the updates is not merged (and the repo stays on an old uCI version), it would be nice if this was included in the next update, just in case. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, we might also want to enrol a new repository that's not on latest Go yet and still uses ioutil
- it'd come in handy then too.
Let me just remove the if-clause then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you @galargh!
Does it make sense to try this out with one or two repos first?
Definitely! I was going to use |
Tested on:
|
* automate cleaning up deprecated io/ioutil * remove target version guard and add goimports install * install goimports by providing the tag name
Following up on #366 (comment)
I tested the newly added part locally on
ipfs/go-ipfs-files
(note, that particular repo will require manual intervention anyway because it usesioutil.ReadDir
too but I think most other repos don't).Merging to
master
because it will only affect the repos with unmerged upgrades to Go 1.19.