docs/man/mangen: format output according to goimports
goimports now fails when using the -l option and any file has been changed. In our case, this occurs in our CI run, since we run make to generate the commands/mancontent_gen.go file and then run make test, which formats it. Since the only formatting error here is an indentation problem, this is easy to fix by inserting a tab at the beginning of the three of our output statements. This is both easy and straightforward, so let's do it.
This commit is contained in:
parent
1de68dcc29
commit
5c0165f05a
@ -63,8 +63,8 @@ func main() {
|
|||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
}
|
}
|
||||||
out.WriteString("package commands\n\nfunc init() {\n")
|
out.WriteString("package commands\n\nfunc init() {\n")
|
||||||
out.WriteString("// THIS FILE IS GENERATED, DO NOT EDIT\n")
|
out.WriteString("\t// THIS FILE IS GENERATED, DO NOT EDIT\n")
|
||||||
out.WriteString("// Use 'go generate ./commands' to update\n")
|
out.WriteString("\t// Use 'go generate ./commands' to update\n")
|
||||||
fileregex := regexp.MustCompile(`git-lfs(?:-([A-Za-z\-]+))?.\d.ronn`)
|
fileregex := regexp.MustCompile(`git-lfs(?:-([A-Za-z\-]+))?.\d.ronn`)
|
||||||
headerregex := regexp.MustCompile(`^###?\s+([A-Za-z0-9 ]+)`)
|
headerregex := regexp.MustCompile(`^###?\s+([A-Za-z0-9 ]+)`)
|
||||||
// only pick up caps in links to avoid matching optional args
|
// only pick up caps in links to avoid matching optional args
|
||||||
@ -80,7 +80,7 @@ func main() {
|
|||||||
// This is git-lfs.1.ronn
|
// This is git-lfs.1.ronn
|
||||||
cmd = "git-lfs"
|
cmd = "git-lfs"
|
||||||
}
|
}
|
||||||
out.WriteString("ManPages[\"" + cmd + "\"] = `")
|
out.WriteString("\tManPages[\"" + cmd + "\"] = `")
|
||||||
contentf, err := os.Open(filepath.Join(manDir, f.Name()))
|
contentf, err := os.Open(filepath.Join(manDir, f.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
warnf(os.Stderr, "Failed to open %v: %v\n", f.Name(), err)
|
warnf(os.Stderr, "Failed to open %v: %v\n", f.Name(), err)
|
||||||
|
Loading…
Reference in New Issue
Block a user