Skip to content

Commit 6fdff97

Browse files
committed
Fix test cases
1 parent 2aa3e1f commit 6fdff97

File tree

1 file changed

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

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ func caarlos0EnvironmentVariables() {
8686

8787
cfg, err = env.ParseAs[config]() // $ source
8888

89+
if err != nil {
90+
return
91+
}
92+
8993
fmt.Printf("HOME: %s\n", cfg.Home)
9094
}
9195

@@ -104,8 +108,8 @@ func syscallEnvironmentVariables() {
104108
fmt.Println("%s", envVar)
105109
}
106110

107-
home, err := syscall.Getenv("HOME") // $ source
108-
if err != nil {
111+
home, found := syscall.Getenv("HOME") // $ source
112+
if !found {
109113
return
110114
}
111115
fmt.Println("HOME: %s", home)

0 commit comments

Comments
 (0)