Skip to content

Commit

Permalink
Merge pull request #74 from geraldywy/geraldywy/fix-example-gosec-issue
Browse files Browse the repository at this point in the history
[gosec-G307] fix gosec issue in example
  • Loading branch information
yoheimuta authored Sep 12, 2022
2 parents 499a1e9 + 7b97678 commit 5e6beb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _example/dump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ func run() int {
fmt.Fprintf(os.Stderr, "failed to open %s, err %v\n", *proto, err)
return 1
}
defer reader.Close()
defer func() {
if err := reader.Close(); err != nil {
fmt.Printf("Error closing file: %s\n", err)
}
}()

got, err := protoparser.Parse(
reader,
Expand Down

0 comments on commit 5e6beb5

Please sign in to comment.