func (m Map) Int(position string) (value int, ok bool) {
	var valueTmp interface{}
	if valueTmp, ok = m.Interface(position); !ok {
		return 0, false
	}
	if value, ok = valueTmp.(int); !ok {
		return 0, false
	}
	return value, true
}
Int returns the int value from position that you passed by argument and a bool if found the field.
if it doesn't find the field the returns is 0 and false.
package nested
import (
	"encoding/json"
	"errors"
	"strings"
	"time"
)
var ErrInvalidInputType = errors.New("this is not a valid input")
type Map map[string]interface{}
func New(in map[string]interface{}) Map {
	if in == nil {
		in = make(map[string]interface{})
	}
	return Map(in)
}
func NewFromJSON(in string) (Map, error) {
	var m Map
	if err := json.Unmarshal([]byte(in), &m); err != nil {
		return nil, ErrInvalidInputType
	}
	return m, nil
}
func NewFromInterface(in interface{}) (Map, error) {
	if m, ok := in.(map[string]interface{}); ok {
		return New(m), nil
	}
	return nil, ErrInvalidInputType
}
func (m Map) GetInterface(position string) interface{} {
	value, _ := m.Interface(position)
	return value
}
func (m Map) Interface(position string) (interface{}, bool) {
	pos := strings.Split(position, ".")
	t := m
	for key, posKey := range pos {
		v, ok := t[posKey]
		if !ok {
			break
		}
		if newValue, ok := v.(map[string]interface{}); ok {
			if key+1 == len(pos) {
				return v, true
			}
			t = newValue
		} else if newString, ok := v.(string); ok {
			return newString, true
		} else if newInt, ok := v.(int); ok {
			return newInt, true
		}
	}
	return nil, false
}
func (m Map) GetString(position string) string {
	value, _ := m.String(position)
	return value
}
func (m Map) String(position string) (value string, ok bool) {
	var valueTmp interface{}
	if valueTmp, ok = m.Interface(position); !ok {
		return "", false
	}
	if value, ok = valueTmp.(string); !ok {
		return "", false
	}
	return value, true
}
func (m Map) GetInt(position string) int {
	value, _ := m.Int(position)
	return value
}