title: Why encoding/json marshals slices as base64?
body: <p>I am writing a SDK for a restful api. It has very very nested structure.</p>
  <p>For example for a part of data.</p>
  <pre><code>type FieldUint8Options struct {
      MinValue  uint8   `json:&quot;min_value&quot;`
      MaxValue  uint8   `json:&quot;max_value&quot;`
      Step      uint    `json:&quot;step&quot;`
      Operation string  `json:&quot;operation&quot;`
      ValueList []uint8 `json:&quot;value_list&quot;`
  }
  
  type TTLOption struct {
      Value       uint8               `json:&quot;value&quot;`
      FieldEngine []FieldUint8Options `json:&quot;field_engine&quot;`
  }
  </code></pre>
  <p>When i marshal initialized data of TTLOption struct, ValueList field turning base64 data.</p>
  <p>Code:</p>
  <pre><code>jsonFile, err := os.Open(&quot;example.json&quot;)
  if err != nil {
      fmt.Println(err)
      os.Exit(0)
  }
      
  byteValue, _ := ioutil.ReadAll(jsonFile)
  
  var ttl TTLOption
  if err := json.Unmarshal(byteValue, &amp;ttl); err != nil {
      fmt.Println(err)
      os.Exit(0)
  }
  
  // I also wrote Custom UnmarshalJSON() interface for TTLOption and FieldUint8Options to handle nil slices.
  data, _ := json.Marshal(ttl)
  fmt.Println(string(data))
  </code></pre>
  <p>Output:</p>
  <pre><code>'ttl': {'value': 123, 'field_engine': [{'min_value': 123, 'max_value': 222, 'step': 1, 'operation': 'random', 'value_list': 'ZA=='}]}}
  </code></pre>
  <p>As you can see value_list is base64 representation. Why it behave like this ?
  Thanks and best regards.</p>