Skip to content

Conversation

@sthagen
Copy link
Owner

@sthagen sthagen commented Feb 23, 2021

In go 1.16 the ioutil package was deprecated and
the functions should be replaced by their equivalents
in either io or os packages. This means,
that ioutil.WriteFile should be replaced by
os.WriteFile instead. To account for this change
and to detect incorrect permissions also for os.WriteFile
I changed filePermissions rule slightly to allows
specifying multiple packages that can contain given
function and that we should check. This workaround
can be removed after a sufficient time has passed
and after it is decided that checking os.WriteFile
is enough.

Fixes: securego#576

In go 1.16 the `ioutil` package was deprecated and
the functions should be replaced by their equivalents
in either `io` or `os` packages. This means,
that `ioutil.WriteFile` should be replaced by
`os.WriteFile` instead. To account for this change
and to detect incorrect permissions also for `os.WriteFile`
I changed `filePermissions` rule slightly to allows
specifying multiple packages that can contain given
function and that we should check. This workaround
can be removed after a sufficient time has passed
and after it is decided that checking `os.WriteFile`
is enough.

Fixes: #576
@sthagen sthagen merged commit fa8c92b into sthagen:master Feb 23, 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.

bug: File permissions check breaks with go1.16

2 participants