docs: Add a hack for golang functions

This commit is contained in:
James Shubin
2024-11-22 14:20:24 -05:00
parent a600e11100
commit 28a443d11d

View File

@@ -548,6 +548,13 @@ func (obj *Generate) genFunctions() (map[string]*FunctionInfo, error) {
//fi.Desc = desc //fi.Desc = desc
fi.Signature = sig 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 == "" { if fi.Func == "" {
return nil, fmt.Errorf("empty function name: %s", name) return nil, fmt.Errorf("empty function name: %s", name)
} }