Skip to content

Commit

Permalink
Merge branch 'main' into hanging-gorouting-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GrosQuildu authored Jun 6, 2024
2 parents 03d98ac + c81344f commit b1e14cc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions go/iterate-over-empty-map.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func main() {
iter1_FP_2()
iter1_FP_3()
iter1_FP_4()
iter1_FP_5()
}

func iter1(){
Expand Down Expand Up @@ -72,3 +73,18 @@ func iter1_FP_4(){
fmt.Println("map item: ", v)
}
}

func iter1_FP_5() {
// https://github.com/semgrep/semgrep/issues/9558
// todook: iterate-over-empty-map
testMap := map[string]int{
"foo": 1,
"bar": 2,
}

keys := make([]string, 0, len(testMap))

for k := range testMap {
keys = append(keys, k)
}
}

0 comments on commit b1e14cc

Please sign in to comment.