Fix gosec for writeFileIfChanged
This commit is contained in:
committed by
Stephen D Marshall
parent
c3fbc5816e
commit
ad0046ab01
@@ -322,6 +322,7 @@ func prepareStanzasToMerge(key string, attrList strings.Builder, iniConfigList [
|
|||||||
// writeFileIfChanged writes the specified data to the specified file path
|
// writeFileIfChanged writes the specified data to the specified file path
|
||||||
// (just like ioutil.WriteFile), but first checks if this is needed
|
// (just like ioutil.WriteFile), but first checks if this is needed
|
||||||
func writeFileIfChanged(path string, data []byte, perm os.FileMode) error {
|
func writeFileIfChanged(path string, data []byte, perm os.FileMode) error {
|
||||||
|
// #nosec G304 - internal utility using file name derived from dspmqinf
|
||||||
current, err := ioutil.ReadFile(path)
|
current, err := ioutil.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user