Skip to content

Commit e62a080

Browse files
authored
Add test for map literal
1 parent 12213a0 commit e62a080

File tree

1 file changed

+8
-0
lines changed
  • go/ql/test/library-tests/semmle/go/dataflow/MapReadsAndStores

1 file changed

+8
-0
lines changed

go/ql/test/library-tests/semmle/go/dataflow/MapReadsAndStores/test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ func main() {
1515
sink(val) // $ hasValueFlow="val"
1616
}
1717
}
18+
19+
func testLiteral() {
20+
someMap := map[string]string {"someKey": source()}
21+
22+
for _, val := range someMap {
23+
sink(val) // $ hasValueFlow="val"
24+
}
25+
}

0 commit comments

Comments
 (0)