From d178958e451f11d4cf55a58a69ccf58c69a96028 Mon Sep 17 00:00:00 2001 From: Yvan Janssens Date: Thu, 6 Apr 2023 09:38:53 +0200 Subject: [PATCH] Fix macOS breakage --- define.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/define.go b/define.go index e373722..c9622db 100644 --- a/define.go +++ b/define.go @@ -5,7 +5,10 @@ package goclamav #include */ import "C" -import "errors" +import ( + "errors" + "fmt" +) // ErrorCode models ClamAV errors type ErrorCode C.cl_error_t @@ -125,7 +128,7 @@ const CL_INIT_DEFAULT C.uint = C.CL_INIT_DEFAULT // Wraps the corresponding error message func Strerr(code ErrorCode) error { - err := errors.New(C.GoString(C.cl_strerror(C.int(code)))) + err := errors.New(fmt.Sprintf("Error %s", C.int(code))) return err }