@@ -219,9 +219,9 @@ func processRemainingDesc(lines *[]string, i int, tabChar string, argDoc *docspb
219219 break
220220 }
221221 if hasContent ((* lines )[i ]) {
222- argDoc .Desc = argDoc . Desc + " " + strings .Trim ((* lines )[i ], tabChar )
222+ argDoc .Desc += " " + strings .Trim ((* lines )[i ], tabChar )
223223 } else {
224- argDoc .Desc = argDoc . Desc + "\n "
224+ argDoc .Desc += "\n "
225225 }
226226 i ++
227227 }
@@ -423,22 +423,23 @@ func parseDocstringAndWrite(outDocs *docspb.StructuredDocs, rawDocstring string,
423423 }
424424 genDocString .body .Name = name
425425
426- if topic == PixieMutation {
426+ switch topic {
427+ case PixieMutation :
427428 outDocs .MutationDocs = append (outDocs .MutationDocs , & docspb.MutationDoc {
428429 Body : genDocString .body ,
429430 FuncDoc : genDocString .function ,
430431 })
431- } else if topic == TracepointDecorator {
432+ case TracepointDecorator :
432433 outDocs .TracepointDecoratorDocs = append (outDocs .TracepointDecoratorDocs , & docspb.TracepointDecoratorDoc {
433434 Body : genDocString .body ,
434435 FuncDoc : genDocString .function ,
435436 })
436- } else if topic == TracepointFields {
437+ case TracepointFields :
437438 outDocs .TracepointFieldDocs = append (outDocs .TracepointFieldDocs , & docspb.TracepointFieldDoc {
438439 Body : genDocString .body ,
439440 FuncDoc : genDocString .function ,
440441 })
441- } else if topic == DataFrameOps {
442+ case DataFrameOps :
442443 body := genDocString .body
443444 if len (opname ) > 0 {
444445 body .Name = opname
@@ -448,12 +449,12 @@ func parseDocstringAndWrite(outDocs *docspb.StructuredDocs, rawDocstring string,
448449 Body : body ,
449450 FuncDoc : genDocString .function ,
450451 })
451- } else if topic == CompileTimeFns {
452+ case CompileTimeFns :
452453 outDocs .CompileFnDocs = append (outDocs .CompileFnDocs , & docspb.CompileFnDoc {
453454 Body : genDocString .body ,
454455 FuncDoc : genDocString .function ,
455456 })
456- } else {
457+ default :
457458 return fmt .Errorf ("topic not found %s" , topic )
458459 }
459460
0 commit comments