title: Structs in GoLang
body: <p>I am just starting with GoLang, and I am looking at one of their tutorials (<a href="https://golang.org/doc/code.html" rel="nofollow">https://golang.org/doc/code.html</a>). </p>
  
  <p>In one of their examples, they set a variable to a struct, but I am so confused as to how they are accessing elements of the struct in the for loop below? Any chance someone can clarify? Thanks alot!</p>
  
  <p>Code:</p>
  
  <pre><code>package stringutil
  
  import "testing"
  
  func TestReverse(t *testing.T) {
      cases := []struct {
          in, want string
      }{
          {"Hello, world", "dlrow ,olleH"},
          {"Hello, 世界", "界世 ,olleH"},
          {"", ""},
      }
      for _, c := range cases {
          got := Reverse(c.in)
          if got != c.want {
              t.Errorf("Reverse(%q) == %q, want %q", c.in, got, c.want)
          }
      }
  }
  </code></pre>