diff --git a/route.go b/route.go index a43dab5..02aefd7 100644 --- a/route.go +++ b/route.go @@ -275,6 +275,12 @@ func (c *RouteConverter) readDescription() (string, string) { } file, _ := handlerValue.FileLine(pc) + if file == "" { + // Fix for Go 1.18 change + // https://github.com/golang/go/issues/51774 + + return funcName, "" + } astFile := c.getAST(file) var doc *ast.CommentGroup