From 28a443d11d5a7ae219e15fa1cd02e438f11874d8 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Fri, 22 Nov 2024 14:20:24 -0500 Subject: [PATCH] docs: Add a hack for golang functions --- docs/generate.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/generate.go b/docs/generate.go index 7788bd6ee5..61cdd6ce75 100644 --- a/docs/generate.go +++ b/docs/generate.go @@ -548,6 +548,13 @@ func (obj *Generate) genFunctions() (map[string]*FunctionInfo, error) { //fi.Desc = desc fi.Signature = sig + // Hack for golang generated functions! + if strings.HasPrefix(fi.Package, "golang/") && fi.File == "generated_funcs.go" { + pkg := fi.Package[len("golang/"):] + frag := strings.TrimPrefix(fi.Name, strings.Title(strings.Join(strings.Split(pkg, "/"), ""))) // yuck + fi.File = fmt.Sprintf("https://pkg.go.dev/%s#%s", pkg, frag) + } + if fi.Func == "" { return nil, fmt.Errorf("empty function name: %s", name) }