Comments (5)
I'm not sure what is the best way to fix this. One approach I know is the following:
- Use version branches instead of version tags. For example, replace
v1.0.0
tag with thev1
branch. - When a new stable branch is created, rewrite import URLs from
github.com/yudai/gojsondiff
togopkg.in/yudai/gojsondiff.v1
. It may be done usingsed
orgomove
.
This is a bit tedious, but should work.
from gojsondiff.
Thanks for the report.
It seems that gopkg.in doesn't handle sub-packages well.
However, I don't feel like rewriting import paths is a good idea. I don't want to add something just relies on gopkg.in.
I rather want users to simply pin a commit ID in their package managers such as glide.
@GAAV you don't want to use a package manager for some reason?
I don't want to break your library again and again, so thinking what's the best way.
from gojsondiff.
Vendoring is a good thing, but I think it should be done in applications, not in libraries.
If every library would vendor all its dependencies (recursively!), we'll get lots of duplicated dependencies. For example, gojsondiff vendors ginkgo and gomega which may be used by httpexpect users, and so will be duplicated.
I prefer the approach when libraries provide stable branches and rely on stable branches of their dependencies, and it's up to applications to vendor them all.
With this scheme, there is no duplication, and the application developer controls updates, which is very important. For example, if a security fix is released for a library foo, there is no need to wait when all libraries that use foo will update their vendored copy of foo. The application developer can just apply the fix immediately because (s)he controls the vendoring.
Actually, the approach of creating a stable branch for every major release is not new and is used for ages outside the Go ecosystem.
I understand the reasons to avoid hardcoding gopkg.in paths. However, if you want a stable branch in Go, you need to choose some way to change import paths. For example you can just create new repos, e.g. gojsondiff2, gojsondiff3, etc. The advantage of gopkg.in is that managing branches is easier than managing repos. After all, you already hardcode github.com paths, and gopkg.in is just another service.
That was some general thoughts about vendoring and versioning in Go. But well, I don't mind vendoring gojsondiff in httpexpect if you'll choose not to provide a stable branch. Anyway, I suggest to document gojsondiff versioning scheme in README.
from gojsondiff.
Maybe it's better to move formatter to the main package? let me see...
from gojsondiff.
Sorry, I was wrong in the assumption that indirect dependencies vendored multiple times are duplicated. Instead, Go package managers flatten all nested vendor directories and every package is used exactly once. Therefore, my arguments related to the package duplication don't apply.
However, employing vendoring in libraries is problematic with flattening too. Problems will arise when different libraries vendor different incompatible versions of the same package with the same import path. Actually it seems to be even stronger argument to avoid vendoring in libraries.
from gojsondiff.
Related Issues (20)
- Missing dependencies in vendor/ HOT 1
- New Release: gojsondiff v2.0 HOT 1
- newline delimited json
- Delta colors/diff not shown HOT 2
- Confusing Array Diff Output HOT 1
- how to deal with diffs of JSON where order of array elements isn't important HOT 2
- badcase report
- Incorrect diff when first item of array changed
- Text diff is incorrectly deserialized
- jd format changes integer to scientific notation
- Switch back to k0kubun/pp
- When swapping the value โโof textLeft and textRight, I get different results
- Dependency issue HOT 1
- confused Similarity func when compare two array
- Identical JSON samples with nested arrays are sometimes identified as different
- Doesn't install
- Possibly unecessary dependency from yudai/pp on unmarshaler_test.go HOT 2
- vulnerability : CVE-2022-29526 present in 1.0.0 release
- Two non-identical int64 numbers with 17 digits were compared, and the result obtained was the same.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gojsondiff.