diff --git a/internal/mkcgo/generate.go b/internal/mkcgo/generate.go index 3030d813..2c79ba38 100644 --- a/internal/mkcgo/generate.go +++ b/internal/mkcgo/generate.go @@ -275,7 +275,6 @@ func (r *rets) useLongHandleErrorCode(retvar, msg string) string { if strings.HasSuffix(r.typ, "*") || strings.HasSuffix(strings.ToUpper(r.typ), "_PTR") { cond = retvar + " == nil" } else { - cond = retvar + " != " + defaultErrorCodeStr cond = strings.Replace(r.failCond, "retval", retvar, 1) } return fmt.Sprintf(code, cond, msg) diff --git a/internal/mkcgo/mkcgo.go b/internal/mkcgo/mkcgo.go index 8d91cbd2..403846f8 100644 --- a/internal/mkcgo/mkcgo.go +++ b/internal/mkcgo/mkcgo.go @@ -10,10 +10,6 @@ import ( "strings" ) -var ( - defaultErrorCodeStr string -) - var ( fileName = flag.String("out", "", "output file name (standard output if omitted)") includeHeader = flag.String("include", "", "include header file")