title: (un)marshalling json golang not working
body: <p>I'm playing with Go and am stumped as to why json encode and decode don't work for me</p>
  
  <p>I think i copied the examples almost verbatim, but the output says both marshal and unmarshal return no data. They also don't give an error.</p>
  
  <p>can anyone hint to where i'm going wrong?</p>
  
  <p>my sample code: <a href="http://play.golang.org/p/2CJezJur01" rel="noreferrer">Go playground</a></p>
  
  <pre><code>package main
  
  import "fmt"
  import  "encoding/json"
  
  type testStruct struct {
      clip string `json:"clip"`
  }
  
  func main() {
  //unmarshal test
      var testJson = "{\"clip\":\"test\"}"
      var t testStruct
      var jsonData = []byte(testJson)
      err := json.Unmarshal(jsonData, &amp;t)
      if err != nil {
          fmt.Printf("There was an error decoding the json. err = %s", err)
          return
      }
      fmt.Printf("contents of decoded json is: %#v\r\n", t)
  
  //marshal test
      t.clip = "test2"
      data, err := json.Marshal(&amp;t)
      if err != nil {
           fmt.Printf("There was an error encoding the json. err = %s", err)
           return
      }
      fmt.Printf("encoded json = %s\r\n", string(data))
  }
  </code></pre>
  
  <p>output:</p>
  
  <pre><code> contents of decoded json is: main.testStruct{clip:""}
   encoded json = {}
  </code></pre>
  
  <p>in both outputs I would have expected to see the decoded or encoded json</p>