Imports #
"bufio"
"fmt"
"io"
"os"
"strings"
"text/template"
"unicode"
"unicode/utf8"
"cmd/go/internal/base"
"cmd/internal/telemetry/counter"
"cmd/go/internal/base"
"bufio"
"fmt"
"io"
"os"
"strings"
"text/template"
"unicode"
"unicode/utf8"
"cmd/go/internal/base"
"cmd/internal/telemetry/counter"
"cmd/go/internal/base"
var HelpBuildConstraint = *ast.UnaryExpr
var HelpBuildJSON = *ast.UnaryExpr
var HelpBuildmode = *ast.UnaryExpr
var HelpC = *ast.UnaryExpr
var HelpCache = *ast.UnaryExpr
var HelpEnvironment = *ast.UnaryExpr
var HelpFileType = *ast.UnaryExpr
var HelpGoAuth = *ast.UnaryExpr
var HelpGopath = *ast.UnaryExpr
var HelpImportPath = *ast.UnaryExpr
var HelpPackages = *ast.UnaryExpr
var counterErrorsHelpUnknownTopic = *ast.CallExpr
var documentationTemplate = *ast.BinaryExpr
var helpTemplate = `{{if .Runnable}}usage: {{.UsageLine}}
{{end}}{{.Long | trim}}
`
var usageTemplate = `{{.Long | trim}}
Usage:
{{.UsageLine}} [arguments]
The commands are:
{{range .Commands}}{{if or (.Runnable) .Commands}}
{{.Name | printf "%-11s"}} {{.Short}}{{end}}{{end}}
Use "go help{{with .LongName}} {{.}}{{end}} " for more information about a command.
{{if eq (.UsageLine) "go"}}
Additional help topics:
{{range .Commands}}{{if and (not .Runnable) (not .Commands)}}
{{.Name | printf "%-15s"}} {{.Short}}{{end}}{{end}}
Use "go help{{with .LongName}} {{.}}{{end}} " for more information about that topic.
{{end}}
`
commentWriter writes a Go comment to the underlying io.Writer, using line comment form (//).
type commentWriter struct {
W io.Writer
wroteSlashes bool
}
An errWriter wraps a writer, recording whether a write error occurred.
type errWriter struct {
w io.Writer
err error
}
Help implements the 'help' command.
func Help(w io.Writer, args []string)
func PrintUsage(w io.Writer, cmd *base.Command)
func (c *commentWriter) Write(p []byte) (int, error)
func (w *errWriter) Write(b []byte) (int, error)
func capitalize(s string) string
tmpl executes the given template text on data, writing the result to w.
func tmpl(w io.Writer, text string, data any)
Generated with Arrow