title: Is it "bad form" to perform map lookup and type assertion in one statement?
body: <p>I just realized that it's possible to do a map lookup and a type/interface-assertion in one statement.</p>
  
  <pre><code>m := map[string]interface{}{
      "key": "the value",
  }
  if value, ok := m["key"].(string); ok {
      fmt.Printf("value exists and is a string: %s\n", value)
  } else {
      fmt.Println("value does not exist or is not a string")
  }
  </code></pre>
  
  <p>Is this considered bad?
  I've not seen any official documentation commenting this.</p>
  
  <p>edit: I know this code can not distinguish between "key doesn't exist" and "value is of incorrect type".</p>
  
  <p>edit2: ahem, the print in the else-clause was incorrect :(</p>