title: Return first n chars of a string
body: <p>What is the best way to return first n chars as substring of a string, when there isn't n chars in the string, just return the string itself.</p>
  
  <p>I can do the following:</p>
  
  <pre><code>func firstN(s string, n int) string {
       if len(s) &gt; n {
            return s[:n]
       }
       return s
  }
  </code></pre>
  
  <p>but is there a cleaner way?</p>
  
  <p>BTW, in Scala, I can just do <code>s take n</code>.</p>