title: What is a rune?
body: <p>What is a <code>rune</code> in Go?</p>
  
  <p>I've been googling but Golang only says in one line: <em><code>rune</code> is an alias for <code>int32</code></em>.</p>
  
  <p>But how come integers are used all around like swapping cases?</p>
  
  <p>The following is a function swapcase.
  What is all the <code>&lt;=</code> and <code>-</code>?</p>
  
  <p>And why doesn't <code>switch</code> have any arguments? </p>
  
  <p><code>&amp;&amp;</code> should mean <em>and</em> but what is <code>r &lt;= 'z'</code>?</p>
  
  <pre><code>func SwapRune(r rune) rune {
      switch {
      case 'a' &lt;= r &amp;&amp; r &lt;= 'z':
          return r - 'a' + 'A'
      case 'A' &lt;= r &amp;&amp; r &lt;= 'Z':
          return r - 'A' + 'a'
      default:
          return r
      }
  }
  </code></pre>
  
  <p>Most of them are from <a href="http://play.golang.org/p/H6wjLZj6lW">http://play.golang.org/p/H6wjLZj6lW</a></p>
  
  <pre><code>func SwapCase(str string) string {
      return strings.Map(SwapRune, str)
  }
  </code></pre>
  
  <p>I understand this is mapping <code>rune</code> to <code>string</code> so that it can return the swapped string. But I do not understand how exactly <code>rune</code> or <code>byte</code> works here.</p>