testify icon indicating copy to clipboard operation
testify copied to clipboard

integrate github.com/pmezard/go-difflib

Open obsti8383 opened this issue 2 years ago • 3 comments

Summary

Since go-difflib is unmaintained since quite some time, the required functions have been taken over into a separate testify package.

Motivation

Unmaintained packages might vanish or be taken over by attackers.

Related issues

Closes #1187 Closes #1159 Closes #736

obsti8383 avatar Jun 05 '22 16:06 obsti8383

It's a good idea but would it not be easier to just pin to the latest version in our go.mod file and break on any hash changes (go.sum, we already do that in the CI jobs).

I get the problem of what happens if the package vanishes, would vendoring not be an easier solution then?

boyan-soubachov avatar Jun 21 '22 10:06 boyan-soubachov

It's a good idea but would it not be easier to just pin to the latest version in our go.mod file and break on any hash changes (go.sum, we already do that in the CI jobs).

go.mod already PINs the version, so that doesn't change anything. Pulling everything into this repo gives the advantage that you don't upgrade to a malicious version by accident.

Main advantage of moving all used code into this repo is that you get rid of concerns by using an unmaintained source code, by maintaining it yourself (see all three issues).

I've also included only the used functions, which makes the code base smaller.

I get the problem of what happens if the package vanishes, would vendoring not be an easier solution then?

As far as I understand vendoring it doesn't bring any advantages here, since command like "go get" will still use the original repository and you don't get rid of the dependency.

obsti8383 avatar Jun 21 '22 18:06 obsti8383

@boyan-soubachov @ernesto-jimenez, could we have a look at this?

miguelalcantar avatar Oct 05 '22 18:10 miguelalcantar

Would love to see this integrated as well.

ilkka avatar Mar 03 '23 11:03 ilkka

Looking forward to having github.com/pmezard/go-difflib integrated.

TReadOnly avatar Jun 09 '23 10:06 TReadOnly

Any update on this ? Can this be merged.

bmv126 avatar Jul 18 '23 10:07 bmv126

We have enough code to maintain and not enough maintainer.

We should instead investigate using another library that provides the same features.

dolmen avatar Oct 30 '23 23:10 dolmen

How about https://github.com/martinohmann/go-difflib ?

bmv126 avatar Nov 12 '23 06:11 bmv126

@miguelalcantar Why do you "need" that change?

dolmen avatar Nov 19 '23 07:11 dolmen

Move package difflib to internal/difflib.

@dolmen You closed this PR 3 weeks ago. What do you mean?

obsti8383 avatar Nov 19 '23 08:11 obsti8383