title: Prevent alphabetically ordering json at Marshal
body: <p>I want to prevent alphabetically reordering at Marshal. My script is below. <code>{"key3": "value3", "key2": "value2", "key1": "value1"}</code> is reordered to <code>{"key1":"value1","key2":"value2","key3":"value3"}</code> by Marshal. I thought <a href="https://stackoverflow.com/questions/25182923/serialize-a-map-using-a-specific-order">this</a> may be close issue. But I could not solve my issue. Is there way to solve this?</p>
  
  <h3>Script</h3>
  
  <pre><code>package main
  
  import (
      "encoding/json"
      "fmt"
  )
  
  func main() {
      obj := `{"key3": "value3", "key2": "value2", "key1": "value1"}`
      var o map[string]interface{}
      json.Unmarshal([]byte(obj), &amp;o)
      fmt.Println(o)
      r, _ := json.Marshal(o)
      fmt.Println(string(r))
  }
  </code></pre>
  
  <p><a href="https://play.golang.org/p/H19JwUwOvr8" rel="noreferrer">play.golang.org</a></p>
  
  <ul>
  <li><code>fmt.Println(o)</code> is <code>map[key3:value3 key2:value2 key1:value1]</code>.</li>
  <li><code>fmt.Println(string(r))</code> is <code>{"key1":"value1","key2":"value2","key3":"value3"}</code>.</li>
  </ul>
  
  <p>Thank you so much for your time. And I'm sorry for my immature question.</p>