Prevent panic when assembling the import details

This commit is contained in:
stack72 2020-11-09 14:45:55 +00:00
parent c389dec868
commit f1b8bc79e2

View file

@ -119,7 +119,7 @@ func decomposeDocstring(docstring string) docInfo {
description := schema.RenderDocsToString(source, parsed)
importDetails := ""
parts := strings.Split(description, "\n\n## Import")
if len(parts) > 0 {
if len(parts) > 1 { // we only care about the Import section details here!!
importDetails = parts[1]
}