Skip to content

Commit ed36aaa

Browse files
committed
Fix some minor issues
1 parent 69679de commit ed36aaa

File tree

1 file changed

+7
-4
lines changed
  • go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/environment

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func godotenvEnvironmentVariables() {
4343
return
4444
}
4545

46-
username := users["USERNAME"]
46+
username = users["USERNAME"]
4747

4848
greetings, err := godotenv.Unmarshal("HELLO=hello")
4949
if err != nil {
@@ -56,11 +56,14 @@ func godotenvEnvironmentVariables() {
5656
}
5757

5858
func envparseEnvironmentVariables() {
59-
f := os.OpenRead("file.txt")
59+
f, err := os.Open("file.txt")
60+
if err != nil {
61+
return
62+
}
6063
defer f.Close()
61-
envVars, ok := envparse.Parse(f)
64+
envVars, err := envparse.Parse(f)
6265

63-
if !ok {
66+
if err != nil {
6467
return
6568
}
6669

0 commit comments

Comments
 (0)