diff --git a/Makefile b/Makefile index b2e5554..34533bb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ NAME=etcd-export -SRCDIR=src/github.com/mickep76/${NAME} +SRCDIR=src/github.com/mickep76 TMPDIR=.build -VERSION:=$(shell awk -F '"' '/Version/ {print $$2}' ${SRCDIR}/../common/version.go) +VERSION:=$(shell awk -F '"' '/Version/ {print $$2}' ${SRCDIR}/common/version.go) RELEASE:=$(shell date -u +%Y%m%d%H%M) ARCH:=$(shell uname -p) diff --git a/example.json b/example.json index 4696645..dd68999 100644 --- a/example.json +++ b/example.json @@ -1,17 +1,12 @@ -{ - "example": { - "groupname": "staff", - "users": { - "0": { +[ + { "first_name": "John", "last_name": "Doe", "username": "jdoe" - }, - "1": { + }, + { "first_name": "Leonard", "last_name": "Nimoy", "username": "lnemoy" - } } - } -} +] diff --git a/src/github.com/mickep76/common/version.go b/src/github.com/mickep76/common/version.go index 628f563..355cbd4 100644 --- a/src/github.com/mickep76/common/version.go +++ b/src/github.com/mickep76/common/version.go @@ -1,4 +1,4 @@ package common // Version -const Version = "0.7" +const Version = "0.8" diff --git a/src/github.com/mickep76/etcd-import/etcd-import.go b/src/github.com/mickep76/etcd-import/etcd-import.go index 2658df9..282e2e1 100644 --- a/src/github.com/mickep76/etcd-import/etcd-import.go +++ b/src/github.com/mickep76/etcd-import/etcd-import.go @@ -56,7 +56,7 @@ func main() { client := etcd.NewClient(conn) // Import data. - m := make(map[string]interface{}) + var m interface{} if (fi.Mode() & os.ModeCharDevice) == 0 { b, _ := ioutil.ReadAll(os.Stdin) var err error diff --git a/vendor/manifest b/vendor/manifest index 7324d6c..2b816a2 100644 --- a/vendor/manifest +++ b/vendor/manifest @@ -23,7 +23,7 @@ { "importpath": "github.com/mickep76/iodatafmt", "repository": "https://github.com/mickep76/iodatafmt", - "revision": "59ffc80835fd66a87ff6fe1d2285ac674b44a376", + "revision": "b5f35dceb02687161ea4c8e6dcbcf1fec8676131", "branch": "master" }, { diff --git a/vendor/src/github.com/mickep76/iodatafmt/iodatafmt.go b/vendor/src/github.com/mickep76/iodatafmt/iodatafmt.go index 61b7b33..116b31a 100644 --- a/vendor/src/github.com/mickep76/iodatafmt/iodatafmt.go +++ b/vendor/src/github.com/mickep76/iodatafmt/iodatafmt.go @@ -28,8 +28,8 @@ const ( ) // Unmarshal YAML/JSON/TOML serialized data. -func Unmarshal(b []byte, f DataFmt) (map[string]interface{}, error) { - d := make(map[string]interface{}) +func Unmarshal(b []byte, f DataFmt) (interface{}, error) { + var d interface{} switch f { case YAML: @@ -52,7 +52,7 @@ func Unmarshal(b []byte, f DataFmt) (map[string]interface{}, error) { } // Marshal YAML/JSON/TOML serialized data. -func Marshal(d map[string]interface{}, f DataFmt) ([]byte, error) { +func Marshal(d interface{}, f DataFmt) ([]byte, error) { switch f { case YAML: b, err := yaml.Marshal(&d) @@ -110,7 +110,7 @@ func FileFormat(fn string) (DataFmt, error) { } // Load a file with serialized data. -func Load(fn string, f DataFmt) (map[string]interface{}, error) { +func Load(fn string, f DataFmt) (interface{}, error) { if _, err := os.Stat(fn); os.IsNotExist(err) { return nil, errors.New("file doesn't exist") }