Skip to content

Commit

Permalink
docs: Add a hack for golang functions
Browse files Browse the repository at this point in the history
  • Loading branch information
purpleidea committed Nov 22, 2024
1 parent a600e11 commit 28a443d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 28a443d

Please sign in to comment.