title: Go: cast any int value to int64 in type switch
body: <p>I often have a situation, where I expect an <code>int</code> (of any type, <code>int/int8/16/32/64</code>) and check for it using a type switch</p>
  
  <pre><code>switch t := v.(type) {
    case int, int8, int16, int32, int64:
      // cast to int64
    case uint, uint8, uint16, uint32, uint64:
      // cast to uint64
  }
  </code></pre>
  
  <p>Now I cannot use a direct cast, because <code>t</code> in this case will be of type <code>interface{}</code>. Do I really have to split this up into <code>case</code>s for each integer type?</p>
  
  <p>I know that I could do it via reflection using <code>reflect.ValueOf(v).Int()</code>, but shouldn't there be a better (less verbose) way of doing this?</p>
  
  <p><em><strong>UPDATE:</em></strong></p>
  
  <p>Filed an issue, and Rob advised to just use <code>reflect</code> in this case.</p>