diff --git a/.travis.yml b/.travis.yml index 15b9547c..eaac2a95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: go go: - - 1.7.x + - 1.9.x script: - scripts/devtools.sh - make local build diff --git a/Dockerfile.dev b/Dockerfile.dev index 78049226..03923ef9 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM golang:1.7 +FROM golang:1.9 COPY scripts/devtools.sh /opt/devtools.sh @@ -14,6 +14,8 @@ RUN set -ex \ && apt-get update && apt-get install -y --no-install-recommends \ $buildDeps \ python2.7 \ + python-setuptools \ + python-wheel \ python-pip \ && pip install --upgrade \ pip \ diff --git a/data_navigator.go b/data_navigator.go index cd777205..c98983b6 100644 --- a/data_navigator.go +++ b/data_navigator.go @@ -196,24 +196,6 @@ func mapToMapSlice(data map[interface{}]interface{}) yaml.MapSlice { // because the parsing of the yaml was done via a map the order will be inconsistent // apply order to allow a consistent output - // Only available in Go 1.8+ - // sort.SliceStable(mapSlice, func(i, j int) bool { return mapSlice[i].Key < mapSlice[j].Key }) - sort.Sort(sortMap{mapSlice}) + sort.SliceStable(mapSlice, func(i, j int) bool { return mapSlice[i].Key.(string) < mapSlice[j].Key.(string) }) return mapSlice } - -type sortMap struct { - ms yaml.MapSlice -} - -func (m sortMap) Len() int { - return len(m.ms) -} - -func (m sortMap) Less(i, j int) bool { - return m.ms[i].Key.(string) < m.ms[j].Key.(string) -} - -func (m sortMap) Swap(i, j int) { - m.ms[i], m.ms[j] = m.ms[j], m.ms[i] -}