diff --git a/0001-Convert-int-to-string-using-rune.patch b/0001-Convert-int-to-string-using-rune.patch new file mode 100644 index 0000000..9cb120a --- /dev/null +++ b/0001-Convert-int-to-string-using-rune.patch @@ -0,0 +1,33 @@ +From c38fc1a2bd79c534328e7451db6e708d7cccd972 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= +Date: Sat, 8 Aug 2020 01:13:39 +0200 +Subject: [PATCH] Convert int to string using rune() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +See https://github.com/golang/go/issues/32479 + +Fix #111. + +Signed-off-by: Robert-André Mauchin +--- + diffmatchpatch/patch.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/diffmatchpatch/patch.go b/diffmatchpatch/patch.go +index 223c43c..0dbe3bd 100644 +--- a/diffmatchpatch/patch.go ++++ b/diffmatchpatch/patch.go +@@ -324,7 +324,7 @@ func (dmp *DiffMatchPatch) PatchAddPadding(patches []Patch) string { + paddingLength := dmp.PatchMargin + nullPadding := "" + for x := 1; x <= paddingLength; x++ { +- nullPadding += string(x) ++ nullPadding += string(rune(x)) + } + + // Bump all the patches forward. +-- +2.26.2 + diff --git a/golang-github-sergi-diff.spec b/golang-github-sergi-diff.spec index 603def8..be3d6fe 100644 --- a/golang-github-sergi-diff.spec +++ b/golang-github-sergi-diff.spec @@ -30,6 +30,8 @@ Summary: Diff, match and patch text in Go License: ASL 2.0 and MIT URL: %{gourl} Source0: %{gosource} +# Go 1.15: https://github.com/sergi/go-diff/issues/111 +Patch0: 0001-Convert-int-to-string-using-rune.patch %if %{with check} # Tests @@ -43,6 +45,7 @@ BuildRequires: golang(github.com/stretchr/testify/assert) %prep %goprep +%patch0 -p1 %install %gopkginstall