Conversation
src/cmd/cgogen.go
Outdated
| call_func_code = | ||
| jen.List(retvars...).Op(":=").Id(fdecl.Name.Name).Call(callparams...) | ||
| } | ||
| callFuncCode = |
There was a problem hiding this comment.
why remove this conditional statement ?
There was a problem hiding this comment.
I already analyze mainPackage at the beginning, that rounds code
src/cmd/cgogen.go
Outdated
| } else { | ||
| call_func_code = jen.Id(fdecl.Name.Name).Call(callparams...) | ||
| } | ||
| callFuncCode = jen.Qual(mainPackagePath+packagePath, |
There was a problem hiding this comment.
why removed this conditional statement ?
There was a problem hiding this comment.
I already analyze mainPackage at the beginning, that rounds code
| } | ||
| leftPart = leftPart.Parens(jen.Op("*").Id(packName).Id(".").Id(typeName)). | ||
| Parens(jen.Qual("unsafe", "Pointer").Parens(jen.Id(argName(name)))) | ||
| if typeName == "FeeCalculator" { |
There was a problem hiding this comment.
cgogen code has to be generic , it must not depend upon specific names of a particular library used as input
There was a problem hiding this comment.
in my opinion , maybe this check should be about whether type was defined as ast.FuncType .
There was a problem hiding this comment.
The problem of callbacks that are very specific. And the functions are different, it can't be treated that way.
There was a problem hiding this comment.
it definitely can't be treated as hard-coded type names belonging in a separate library package .
There was a problem hiding this comment.
exactly then what do you suggest
Fixes #17
Changes:
callbackincoin.transactionsDoes this change need to mentioned in CHANGELOG.md?
No