title: Parse string to specific type of int (int8, int16, int32, int64)
body: <p>I am trying to parse a string into an integer in Go. The Problem I found with it is in the documentation its mentioned syntax is as follows:</p>
  
  <pre><code>ParseInt(s string, base int, bitSize int)
  </code></pre>
  
  <p>where, <code>s</code> is the string to be parsed, <code>base</code> is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise. </p>
  
  <p>The <code>bitSize</code> parameter is where I am facing problem. As per documentation of <a href="http://golang.org/pkg/strconv/#ParseInt" rel="noreferrer">ParseInt</a>, it specifies the integer type that the result must fit into. Bit sizes 0, 8, 16, 32, and 64 correspond to int, int8, int16, int32, and int64.</p>
  
  <p>But for all the values like 0, 8, 16, 32, and 64. I am getting same type return value. I.e of int64 type. </p>
  
  <p>Could anyone point me out what am I missing.</p>
  
  <p>Code:  <a href="https://play.golang.org/p/F3LbUh_maY" rel="noreferrer">https://play.golang.org/p/F3LbUh_maY</a></p>