title: Why map and type assertion can return 1 or 2 values?
body: <p>To define a map, we can do such a thing:</p>
  
  <p><code>value, present := m["key"]</code></p>
  
  <p>or:</p>
  
  <p><code>value := m["key"]</code></p>
  
  <p>and with type assertion, we can do:</p>
  
  <pre><code>var i interface{} = "hello"
  
  s := i.(string)
  fmt.Println(s)
  
  s, ok := i.(string)
  fmt.Println(s, ok)
  </code></pre>
  
  <p>but I can't find a way to define a func that can return 1 value or 2-values. </p>
  
  <p>For instance:</p>
  
  <pre><code>func hello() (string, error) {
      return "world", nil
  }
  </code></pre>
  
  <p>When I invoke this func I get:</p>
  
  <pre><code>v, ok := hello() // valid
  v := hello() // invalid
  </code></pre>
  
  <p>PS: I know how something like <code>template.Must</code> works, but it seems different. I really want to know how Map and type assertion can do the magic, so I can apply it to functions.</p>
  
  <p>Thanks in advance. (Am I clear? I have poor English sorry).</p>