title: Check if string is int
body: <p>How can I check if a string value is an integer or not in Go?</p>
  <p>Something like</p>
  <pre><code>v := &quot;4&quot;
  if isInt(v) {
    fmt.Println(&quot;We have an int, we can safely cast this with strconv&quot;)
  }
  </code></pre>
  <p>Note: I know that <code>strconv.Atoi</code> returns an error, but is there any other function to do this?</p>
  <p><s>The problem with <code>strconv.Atoi</code> is that it will return <code>7</code> for <code>&quot;a7&quot;</code></s></p>