Skip to content

Commit

Permalink
Fix GoSec Test (#258)
Browse files Browse the repository at this point in the history
* (feat) fix gosec test

* change approach
  • Loading branch information
hi-artem committed Dec 21, 2021
1 parent a9cbb71 commit 68a8a2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/yaml/yaml_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
const SingleIndent = " "

func WriteYAMLFile(readFilePath string, blocks []structure.IBlock, writeFilePath string, tagsAttributeName string, resourcesStartToken string) error {
// read file bytes
// #nosec G304
// read file bytes
originFileSrc, err := ioutil.ReadFile(readFilePath)
if err != nil {
return fmt.Errorf("failed to read file %s because %s", readFilePath, err)
Expand Down
4 changes: 2 additions & 2 deletions src/terraform/structure/terraform_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func (p *TerrraformParser) ValidFile(_ string) bool {
}

func (p *TerrraformParser) ParseFile(filePath string) ([]structure.IBlock, error) {
// read file bytes
// #nosec G304
// read file bytes
src, err := ioutil.ReadFile(filePath)
if err != nil {
return nil, fmt.Errorf("failed to read file %s because %s", filePath, err)
Expand Down Expand Up @@ -171,8 +171,8 @@ func (p *TerrraformParser) ParseFile(filePath string) ([]structure.IBlock, error
}

func (p *TerrraformParser) WriteFile(readFilePath string, blocks []structure.IBlock, writeFilePath string) error {
// read file bytes
// #nosec G304
// read file bytes
src, err := ioutil.ReadFile(readFilePath)
if err != nil {
return fmt.Errorf("failed to read file %s because %s", readFilePath, err)
Expand Down

0 comments on commit 68a8a2b

Please sign in to comment.