This tests if a map contains a certain value:
_, ok := myMap["foo"]
Is there a way to use this check in an if statement, so that I can chain multiple tests together?
if ("foo" in map1) || ("bar" in map2) {
// do stuff
}
This should be roughly what you're looking for.
if _, ok := myMap["foo"]; ok {
//do stuff
}
You should be able to chain multiple statements in the parentheses so that you can have multiple checks at a time.
if (_, okfoo := myMap["foo"]; _, okbar := myMap["bar"]; okfoo || okbar) {
// do stuff
}