Fix macOS breakage
This commit is contained in:
parent
463f2ad21d
commit
d178958e45
@ -5,7 +5,10 @@ package goclamav
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
import "errors"
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
// ErrorCode models ClamAV errors
|
// ErrorCode models ClamAV errors
|
||||||
type ErrorCode C.cl_error_t
|
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
|
// Wraps the corresponding error message
|
||||||
func Strerr(code ErrorCode) error {
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user