[pkg-go] Bug#1007789: golang-github-matryer-try: FTBFS with Go 1.18

William 'jawn-smith' Wilson jawn-smith at ubuntu.com
Wed Mar 16 18:57:21 GMT 2022


Package: golang-github-matryer-try
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu jammy ubuntu-patch

Dear Maintainer,

golang-github-matryer-try currently FTBFS with Go 1.18

In Ubuntu, the attached patch was applied to achieve the following:


  * Remove unused variables to fix FTBFS with Go 1.18


Thanks for considering the patch.


-- System Information:
Debian Release: bookworm/sid
  APT prefers jammy
  APT policy: (500, 'jammy')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.15.0-22-generic (SMP w/32 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
diff -Nru golang-github-matryer-try-1+git20161228.6.9ac251b/debian/patches/fix-ftbfs-with-go1.18.patch golang-github-matryer-try-1+git20161228.6.9ac251b/debian/patches/fix-ftbfs-with-go1.18.patch
--- golang-github-matryer-try-1+git20161228.6.9ac251b/debian/patches/fix-ftbfs-with-go1.18.patch	1969-12-31 18:00:00.000000000 -0600
+++ golang-github-matryer-try-1+git20161228.6.9ac251b/debian/patches/fix-ftbfs-with-go1.18.patch	2022-03-16 13:50:42.000000000 -0500
@@ -0,0 +1,43 @@
+Description: Fix FTBFS with Go 1.18
+ Go 1.18 is more strict about unused variables. This patch
+ removes some unused variables to enable building this
+ package against Go 1.18
+Author: William 'jawn-smith' Wilson <jawn-smith at ubuntu.com>
+Forwarded:
+Applied-Upstream: https://github.com/matryer/try/pull/7
+Last-Update: 2022-03-16
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: golang-github-matryer-try-1+git20161228.6.9ac251b/try_test.go
+===================================================================
+--- golang-github-matryer-try-1+git20161228.6.9ac251b.orig/try_test.go
++++ golang-github-matryer-try-1+git20161228.6.9ac251b/try_test.go
+@@ -15,10 +15,9 @@
+ 	SomeFunction := func() (string, error) {
+ 		return "", nil
+ 	}
+-	var value string
+ 	err := try.Do(func(attempt int) (bool, error) {
+ 		var err error
+-		value, err = SomeFunction()
++		_, err = SomeFunction()
+ 		return attempt < 5, err // try 5 times
+ 	})
+ 	if err != nil {
+@@ -30,7 +29,6 @@
+ 	SomeFunction := func() (string, error) {
+ 		panic("something went badly wrong")
+ 	}
+-	var value string
+ 	err := try.Do(func(attempt int) (retry bool, err error) {
+ 		retry = attempt < 5 // try 5 times
+ 		defer func() {
+@@ -38,7 +36,7 @@
+ 				err = errors.New(fmt.Sprintf("panic: %v", r))
+ 			}
+ 		}()
+-		value, err = SomeFunction()
++		_, err = SomeFunction()
+ 		return
+ 	})
+ 	if err != nil {
diff -Nru golang-github-matryer-try-1+git20161228.6.9ac251b/debian/patches/series golang-github-matryer-try-1+git20161228.6.9ac251b/debian/patches/series
--- golang-github-matryer-try-1+git20161228.6.9ac251b/debian/patches/series	1969-12-31 18:00:00.000000000 -0600
+++ golang-github-matryer-try-1+git20161228.6.9ac251b/debian/patches/series	2022-03-16 13:50:07.000000000 -0500
@@ -0,0 +1 @@
+fix-ftbfs-with-go1.18.patch


More information about the Pkg-go-maintainers mailing list