title: Checking length of a string pointer in Go
body: <p>How do I go about finding the length of a string pointer which comes from a struct. Currently I am writing unit tests and want to see whether a string pointer is less than 250 characters. If r is my and myString is a string pointer.</p>
  
  <p>This code is not valid:</p>
  
  <pre><code>if len(r.myString) &gt; 256 {
      return ErrStringTooLong
  }
  </code></pre>