Conversation
|
@ondrej-fabry, correct me if I'm wrong, but isn't binapi's default value tag more like an informative, and is it processed on the VPP side? I think we don't need to pre-fill them during the object creation or reset. @fesily is there any specific scenario where you have to fill the default value by hand, otherwise the call fails, or any example where this is an issue? |
|
Yes, you are correct @VladoLavor However, that does not mean we cannot use the value to prefill. We just have not, because most of the times we build the value directly, this solution request a call to |
| "strconv" | ||
| "strings" | ||
|
|
||
| "go.fd.io/govpp/binapi/ethernet_types" |
There was a problem hiding this comment.
We should not ever depend on the generate binapi. Especially not in the binapigen. Consider binapi and packages under it as example, not as code to be used inside GoVPP. Even projects using GoVPP should generate their own.
| func fieldActualType(field *Field) (actual string) { | ||
| switch { | ||
| case field.TypeAlias != nil: | ||
| case field.TypeAlias != nil && field.TypeAlias.Length == 0: |
There was a problem hiding this comment.
Can you list a case this handles/fixes?
ondrej-fabry
left a comment
There was a problem hiding this comment.
You will need to regenerate existing binapi to pass a check.
govpp does not utilise binapi's prompts for default member values.