Skip to content

Commit

Permalink
Remove debug from gendoc
Browse files Browse the repository at this point in the history
Remove debug from gendoc.

Signed-off-by: David Enyeart <[email protected]>
  • Loading branch information
denyeart committed Feb 13, 2024
1 parent cdae4d4 commit f982a36
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
7 changes: 0 additions & 7 deletions common/metrics/cmd/gendoc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package main
import (
"bytes"
"flag"
"fmt"
"os"
"text/template"

Expand All @@ -35,26 +34,22 @@ func main() {
patterns = []string{"github.com/hyperledger/fabric/..."}
}

fmt.Println("Loading for", patterns[0])
mode := packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles | packages.NeedImports | packages.NeedSyntax | packages.NeedTypesInfo
pkgs, err := packages.Load(&packages.Config{Mode: mode}, patterns...)
if err != nil {
panic(err)
}

fmt.Println("Options")
options, err := gendoc.Options(pkgs)
if err != nil {
panic(err)
}

fmt.Println("NewCells")
cells, err := gendoc.NewCells(options)
if err != nil {
panic(err)
}

fmt.Println("FuncMap")
funcMap := template.FuncMap{
"PrometheusTable": func() string {
buf := &bytes.Buffer{}
Expand All @@ -73,13 +68,11 @@ func main() {
panic(err)
}

fmt.Println("New template")
tmpl, err := template.New("metrics_reference").Funcs(funcMap).Parse(string(docTemplate))
if err != nil {
panic(err)
}

fmt.Println("Execute")
if err := tmpl.Execute(os.Stdout, ""); err != nil {
panic(err)
}
Expand Down
1 change: 0 additions & 1 deletion common/metrics/gendoc/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func Options(pkgs []*packages.Package) ([]interface{}, error) {
var options []interface{}
for _, p := range pkgs {
for _, f := range p.Syntax {
fmt.Println(f.Name.Name)
opts, err := FileOptions(f)
if err != nil {
return nil, err
Expand Down

0 comments on commit f982a36

Please sign in to comment.