How to extract the claims from JWT token
<p>I'm using the dgrijalva/jwt-go/ package.</p>

<p>I would like to extract the payload from the token, and I couldn't find a way to do it.</p>

<hr>

<p>Example (taken from : <a href="https://jwt.io/" rel="noreferrer">https://jwt.io/</a>):</p>

<p>for encoded:</p>

<blockquote>
  <p>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ</p>
</blockquote>

<p>I would like to extract the payload:</p>

<pre><code>{
  "sub": "1234567890",
  "name": "John Doe",
  "admin": true
}
</code></pre>

<hr>

<p>I will be grateful for an example (using golang).</p>