title: getting bits out of a 32bit unsigned integer using bitshift in go lang
body: <p>I have a 32bit unsigned integer and I want to divide it in 3 uint16 values. I want first 15bits, then 2 bits and then last 15 bits.</p>
  
  <p>I am trying something like -</p>
  
  <pre><code>val &gt;&gt; 17
  val &gt;&gt; 2
  val &gt;&gt; 15
  </code></pre>
  
  <p>apart from first value, other 2 are not right and I know that but now able to figure out how to fix that?</p>
  
  <p><a href="http://play.golang.org/p/En31b1kxsw" rel="nofollow">Go play ground</a></p>