title: Using the == symbol in golang and using a loop to compare if string a equals string b,which performance is better?
body: <pre><code>for i:=0;i&lt;len(a);i++{
      if a[i] != b[i]{
          return false
      }
  }
  </code></pre>
  
  <p>and just</p>
  
  <pre><code>a == b
  </code></pre>
  
  <p>I've found that the same string have different address </p>
  
  <pre><code>a := "abc"
  b := "abc"
  println(&amp;a)
  println(&amp;b)
  </code></pre>
  
  <p>answer is :<br>
  0xc420045f68<br>
  0xc420045f58</p>
  
  <p>so == not using address to compare.<br>
  In fact, I would like to know how == compares two strings.<br>
  I am searching for a long time on net. But failed...</p>