diff options
Diffstat (limited to 'cmd/binapi-generator/generate.go')
-rw-r--r-- | cmd/binapi-generator/generate.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/binapi-generator/generate.go b/cmd/binapi-generator/generate.go index d9555e7..1ff3e4c 100644 --- a/cmd/binapi-generator/generate.go +++ b/cmd/binapi-generator/generate.go @@ -256,7 +256,7 @@ func generateImports(ctx *context, w io.Writer) { // generateComment writes generated comment for the object into w func generateComment(ctx *context, w io.Writer, goName string, vppName string, objKind string) { if objKind == "service" { - fmt.Fprintf(w, "// %s represents VPP binary API services in %s module.\n", ctx.moduleName, goName) + fmt.Fprintf(w, "// %s represents VPP binary API services in %s module.\n", goName, ctx.moduleName) } else { fmt.Fprintf(w, "// %s represents VPP binary API %s '%s':\n", goName, objKind, vppName) } @@ -497,7 +497,9 @@ func generateUnion(ctx *context, w io.Writer, union *Union) { generateTypeNameGetter(w, name, union.Name) // generate CRC getter - generateCrcGetter(w, name, union.CRC) + if union.CRC != "" { + generateCrcGetter(w, name, union.CRC) + } // generate getters for fields for _, field := range union.Fields { @@ -589,7 +591,9 @@ func generateType(ctx *context, w io.Writer, typ *Type) { generateTypeNameGetter(w, name, typ.Name) // generate CRC getter - generateCrcGetter(w, name, typ.CRC) + if typ.CRC != "" { + generateCrcGetter(w, name, typ.CRC) + } fmt.Fprintln(w) } |