Skip to content

Conversation

@Juneezee
Copy link
Contributor

@Juneezee Juneezee commented Oct 6, 2021

In Go 1.16 or higher, the io/ioutil has been deprecated and the ioutil.ReadFile function now calls os.ReadFile.

This PR adds the os.ReadFile function into the G304: Potential file inclusion via variable rule.

In Go 1.16 or higher, the `io/ioutil` has been deprecated and the
`ioutil.ReadFile` function now calls `os.ReadFile`.

Signed-off-by: Eng Zer Jun <[email protected]>
jkowalski pushed a commit to kopia/kopia that referenced this pull request Oct 6, 2021
* refactor: move from io/ioutil to io and os package

The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <[email protected]>

* chore: remove //nolint:gosec for os.ReadFile

At the time of this commit, the G304 rule of gosec does not include the
`os.ReadFile` function. We remove `//nolint:gosec` temporarily until
securego/gosec#706 is merged.

Signed-off-by: Eng Zer Jun <[email protected]>
@ccojocar ccojocar merged commit 7fd4aef into securego:master Oct 14, 2021
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