Mainflux.mainflux/vendor/github.com/apapsch/go-jsonmerge/v2
Dušan Borovčanin 412593ae94
NOISSUE - Update dependencies (#1838)
* Update dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update dependencies

Fix Timescale Reader bug.

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Revert influxdb-reader changes

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update dependencies to latest supported versions

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

---------

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-06 20:44:12 +02:00
..
.editorconfig NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
.gitattributes NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
.gitignore NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
.gitlab-ci.yml NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
.travis.yml NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
LICENSE NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
README.md NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
build.cmd NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
build.sh NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
doc.go NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00
merge.go NOISSUE - Update dependencies (#1838) 2023-07-06 20:44:12 +02:00

README.md

go-jsonmerge

Build Status GoDoc

GO library for merging JSON objects

Original document

{  
  "number": 1,
  "string": "value",
  "object": {
    "number": 1,
    "string": "value",
    "nested object": {
      "number": 2
    },
    "array": [1, 2, 3],
    "partial_array": [1, 2, 3]
  }
}

Patch

{  
  "number": 2,
  "string": "value1",
  "nonexitent": "woot",
  "object": {
    "number": 3,
    "string": "value2",
    "nested object": {
      "number": 4
    },
    "array": [3, 2, 1],
    "partial_array": {
      "1": 4
    }
  }
}

Result

{  
  "number": 2,
  "string": "value1",
  "object": {
    "number": 3,
    "string": "value2",
    "nested object": {
      "number": 4
    },
    "array": [3, 2, 1],
    "partial_array": [1, 4, 3]
  }
}

Commandline Tool

$ go get -u github.com/RaveNoX/go-jsonmerge/cmd/jsonmerge
$ jsonmerge [options] <patch.json> <glob1.json> <glob2.json>...<globN.json>
# For help
$ jsonmerge -h

Development

# Install depencencies
./init.sh

# Build
./build.sh

License

MIT