mirror of
https://github.com/spf13/cobra
synced 2024-11-05 05:17:12 +00:00
652c755d37
Use golangci-lint. Repair warnings and errors resulting from linting.
35 lines
588 B
Go
35 lines
588 B
Go
package doc_test
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/cobra/doc"
|
|
)
|
|
|
|
func ExampleGenManTree() {
|
|
cmd := &cobra.Command{
|
|
Use: "test",
|
|
Short: "my test program",
|
|
}
|
|
header := &doc.GenManHeader{
|
|
Title: "MINE",
|
|
Section: "3",
|
|
}
|
|
cobra.CheckErr(doc.GenManTree(cmd, header, "/tmp"))
|
|
}
|
|
|
|
func ExampleGenMan() {
|
|
cmd := &cobra.Command{
|
|
Use: "test",
|
|
Short: "my test program",
|
|
}
|
|
header := &doc.GenManHeader{
|
|
Title: "MINE",
|
|
Section: "3",
|
|
}
|
|
out := new(bytes.Buffer)
|
|
cobra.CheckErr(doc.GenMan(cmd, header, out))
|
|
fmt.Print(out.String())
|
|
}
|