From fb435adfc54726d15f43d25406f59084ce8dc6b0 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Tue, 25 Jun 2019 17:18:25 -0700 Subject: [PATCH 1/2] Use Major subdirectory structure to maintain godep compatiability Signed-off-by: Tamal Saha --- README.md | 3 +-- go.mod => v2/go.mod | 0 go.sum => v2/go.sum | 0 jsonpatch.go => v2/jsonpatch.go | 0 jsonpatch_json_test.go => v2/jsonpatch_json_test.go | 0 jsonpatch_test.go => v2/jsonpatch_test.go | 0 6 files changed, 1 insertion(+), 2 deletions(-) rename go.mod => v2/go.mod (100%) rename go.sum => v2/go.sum (100%) rename jsonpatch.go => v2/jsonpatch.go (100%) rename jsonpatch_json_test.go => v2/jsonpatch_json_test.go (100%) rename jsonpatch_test.go => v2/jsonpatch_test.go (100%) diff --git a/README.md b/README.md index 2ea21f8..8b2c21d 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ JSON Patch allows you to generate JSON that describes changes you want to make t ## Usage ## ```go -import "gomodules.xyz/jsonpatch/v2" // with go modules enabled (GO111MODULE=on or outside GOPATH) -import "gomodules.xyz/jsonpatch" // with go modules disabled +import "gomodules.xyz/jsonpatch/v2" ``` I tried some of the other "jsonpatch" go implementations, but none of them could diff two json documents and generate format like jsonpatch.com specifies. Here's an example of the patch format: diff --git a/go.mod b/v2/go.mod similarity index 100% rename from go.mod rename to v2/go.mod diff --git a/go.sum b/v2/go.sum similarity index 100% rename from go.sum rename to v2/go.sum diff --git a/jsonpatch.go b/v2/jsonpatch.go similarity index 100% rename from jsonpatch.go rename to v2/jsonpatch.go diff --git a/jsonpatch_json_test.go b/v2/jsonpatch_json_test.go similarity index 100% rename from jsonpatch_json_test.go rename to v2/jsonpatch_json_test.go diff --git a/jsonpatch_test.go b/v2/jsonpatch_test.go similarity index 100% rename from jsonpatch_test.go rename to v2/jsonpatch_test.go From a994e7c9cde68c0b24267e9f32712ad5fe9f8784 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Tue, 25 Jun 2019 17:27:56 -0700 Subject: [PATCH 2/2] Fix travis.yml Signed-off-by: Tamal Saha --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e4597b..0066aaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,12 @@ go_import_path: gomodules.xyz/jsonpatch cache: directories: - - $HOME/.cache/go-build - - $GOPATH/pkg/mod + - $HOME/.cache/go-build + - $GOPATH/pkg/mod env: - GO111MODULE=on script: - - go test -v + - cd v2 + - go test -v