If maps are not ordered, why does it display in the correct order when printing ?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • go

    The Go programming language

  • fmt package does the trick for the sake of output reproducibility. It was added in Go 1.12 https://github.com/golang/go/issues/21095

  • mxj

    Decode / encode XML to/from map[string]interface{} (or JSON); extract values with dot-notation paths and wildcards. Replaces x2j and j2x packages.

  • Prior to Go 1.12 unit tests where you wanted to verify a map value - or its serialization in JSON - you needed to visually inspect the output. You couldn't just compare the result to a known string value. (You can see the messy result of this still lingering in older packages, such as, github.com/clbanning/mxj or .../x2j and .../j2x. In fact, similar sorting of map values was added in .../mxj for marshaling XML docs from maps.)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts