man_examples_test.go
This file
Path
doc/man_examples_test.go
35 lines · 588 bytes · Go
Last changed by
Use golangci-lint (#1044)Unai Martinez-Corralbefore adoption652c755
History of this fileTake it
The walk stopped after 200 commits: lines older than 0ea93dd point at it.
Fixed linter issuesJuan Lenibefore adoption0ea93dd
lines 1–19why, one step back1package doc_test23import (4 "bytes"5 "fmt"67 "github.com/spf13/cobra"8 "github.com/spf13/cobra/doc"9)1011func ExampleGenManTree() {12 cmd := &cobra.Command{13 Use: "test",14 Short: "my test program",15 }16 header := &doc.GenManHeader{17 Title: "MINE",18 Section: "3",19 }Use golangci-lint (#1044)Unai Martinez-Corralbefore adoption652c755
line 20why, one step back20 cobra.CheckErr(doc.GenManTree(cmd, header, "/tmp"))Fixed linter issuesJuan Lenibefore adoption0ea93dd
lines 21–32why, one step back21}2223func ExampleGenMan() {24 cmd := &cobra.Command{25 Use: "test",26 Short: "my test program",27 }28 header := &doc.GenManHeader{29 Title: "MINE",30 Section: "3",31 }32 out := new(bytes.Buffer)Use golangci-lint (#1044)Unai Martinez-Corralbefore adoption652c755
line 33why, one step back33 cobra.CheckErr(doc.GenMan(cmd, header, out))Fixed linter issuesJuan Lenibefore adoption0ea93dd
lines 34–35why, one step back34 fmt.Print(out.String())35}