1/*
2Objx - Go package for dealing with maps, slices, JSON and other data.
3
4Overview
5
6Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes
7a powerful `Get` method (among others) that allows you to easily and quickly get
8access to data within the map, without having to worry too much about type assertions,
9missing data, default values etc.
10
11Pattern
12
13Objx uses a preditable pattern to make access data from within `map[string]interface{}` easy.
14Call one of the `objx.` functions to create your `objx.Map` to get going:
15
16    m, err := objx.FromJSON(json)
17
18NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong,
19the rest will be optimistic and try to figure things out without panicking.
20
21Use `Get` to access the value you're interested in.  You can use dot and array
22notation too:
23
24     m.Get("places[0].latlng")
25
26Once you have sought the `Value` you're interested in, you can use the `Is*` methods to determine its type.
27
28     if m.Get("code").IsStr() { // Your code... }
29
30Or you can just assume the type, and use one of the strong type methods to extract the real value:
31
32   m.Get("code").Int()
33
34If there's no value there (or if it's the wrong type) then a default value will be returned,
35or you can be explicit about the default value.
36
37     Get("code").Int(-1)
38
39If you're dealing with a slice of data as a value, Objx provides many useful methods for iterating,
40manipulating and selecting that data.  You can find out more by exploring the index below.
41
42Reading data
43
44A simple example of how to use Objx:
45
46   // Use MustFromJSON to make an objx.Map from some JSON
47   m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`)
48
49   // Get the details
50   name := m.Get("name").Str()
51   age := m.Get("age").Int()
52
53   // Get their nickname (or use their name if they don't have one)
54   nickname := m.Get("nickname").Str(name)
55
56Ranging
57
58Since `objx.Map` is a `map[string]interface{}` you can treat it as such.
59For example, to `range` the data, do what you would expect:
60
61    m := objx.MustFromJSON(json)
62    for key, value := range m {
63      // Your code...
64    }
65*/
66package objx
67