title: Why don't changes made to a struct via a method persist?
body: <p>I'm trying to understand why the following test code is not working as expected:</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "strings"
  )
  
  type Test struct {
      someStrings []string
  }
  
  func (this Test) AddString(s string) {
      this.someStrings = append(this.someStrings, s)
      this.Count() // will print "1"
  }
  
  func (this Test) Count() {
      fmt.Println(len(this.someStrings))
  }
  
  func main() {
      var test Test
      test.AddString("testing")
      test.Count() // will print "0"
  }
  </code></pre>
  
  <p>This would print:</p>
  
  <pre><code>"1"
  "0"
  </code></pre>
  
  <p>Meaning that <code>someStrings</code> is apparently modified... and then it's not.</p>
  
  <p>Anybody know what could be the issue?</p>