Skip to content

Commit 69679de

Browse files
committed
Add defer statement
1 parent 69f0229 commit 69679de

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/environment/test.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
| test.go:34:29:34:32 | &... |
55
| test.go:41:2:41:40 | ... := ...[0] |
66
| test.go:48:2:48:52 | ... := ...[0] |
7+
| test.go:61:2:61:33 | ... := ...[0] |

go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/environment/test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ func godotenvEnvironmentVariables() {
5656
}
5757

5858
func envparseEnvironmentVariables() {
59-
f := os.Open("file.txt")
59+
f := os.OpenRead("file.txt")
60+
defer f.Close()
6061
envVars, ok := envparse.Parse(f)
6162

6263
if !ok {

0 commit comments

Comments
 (0)