You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that it's just used in a test, and that if a main package imports pkg/diff, it won't end up depending on sergi/go-diff at a package level.
However, it's still undesirable for pkg/diff to pull in such relatively heavy dependencies. Beyond go-diff itself, we also end up pulling testify and even a yaml library (!!!).
It's true that this will become less of a concern with lazy module loading. I don't think that's a satisfactory answer though, because it won't ship until at least 1.17 in six months, and people will keep using go 1.16 or earlier in their go.mod files for at least a year or two.
So, I think we should remove it. It seems to only be used in a single test, to show a diff when the unified diff tests fail. I get why we don't want to use our own code; if the diffs are broken, showing a broken diff in the output isn't good.
I see two reasonable options:
Use the host's diff tool in that case, like what gofmt -d does.
Just show the entire output as-is. The tests aren't large, and failures should be rare.
The text was updated successfully, but these errors were encountered:
sergi/go-diff is only used in one test, though having it as a module
dependency is still noteworthy. That will become less of a problem once
lazy module loading is widespread, but that's still at least one year
away.
Plus, we only used go-diff for a simple use case: to show a diff for a
failed diff test. We already print the got/want text, so a diff is
strictly speaking not necessary. Plus, if printing the entire text is
reasonable, it's not like the diff would matter in terms of printing
less text.
While at it, bump the go language version from 1.13 to 1.15, since Go
1.14.x and older are no longer maintained.
Fixespkg#23.
I understand that it's just used in a test, and that if a main package imports pkg/diff, it won't end up depending on sergi/go-diff at a package level.
However, it's still undesirable for pkg/diff to pull in such relatively heavy dependencies. Beyond go-diff itself, we also end up pulling testify and even a yaml library (!!!).
It's true that this will become less of a concern with lazy module loading. I don't think that's a satisfactory answer though, because it won't ship until at least 1.17 in six months, and people will keep using
go 1.16
or earlier in theirgo.mod
files for at least a year or two.So, I think we should remove it. It seems to only be used in a single test, to show a diff when the unified diff tests fail. I get why we don't want to use our own code; if the diffs are broken, showing a broken diff in the output isn't good.
I see two reasonable options:
Use the host's
diff
tool in that case, like whatgofmt -d
does.Just show the entire output as-is. The tests aren't large, and failures should be rare.
The text was updated successfully, but these errors were encountered: