From 0d5cf990a532783870a59a0ecbb8774227c77c14 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Thu, 5 Dec 2024 14:32:18 +0100 Subject: [PATCH] remove unnecessary code --- internal/mkcgo/generate.go | 1 - internal/mkcgo/mkcgo.go | 4 ---- 2 files changed, 5 deletions(-) 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")