Blob Blame History Raw
From bf78cc6b875fd4923cbf1a8dbfb865b6835aa7f2 Mon Sep 17 00:00:00 2001
From: eclipseo <zebob.m@gmail.com>
Date: Sat, 8 Aug 2020 02:02:23 +0000
Subject: [PATCH] Fix Error message in falloc/error.go
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In Go 1.15 rc 1, passing e to Sprintf directly results in an error:

    # modernc.org/fileutil/falloc
    ./error.go:87:9: Sprintf format %s with arg e causes recursive Error method call
    FAIL	modernc.org/fileutil/falloc [build failed]

Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
---
 falloc/error.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/falloc/error.go b/falloc/error.go
index 2827d1c..52b27eb 100644
--- a/falloc/error.go
+++ b/falloc/error.go
@@ -84,7 +84,7 @@ func (e *EHeader) Error() string {
 type ENullHandle string
 
 func (e ENullHandle) Error() string {
-	return fmt.Sprintf("%s: access via null handle", e)
+	return fmt.Sprintf("%s: access via null handle", string(e))
 }
 
 // EOpen is a file/store open error.
-- 
2.26.2