func writeSampleDescription(w io.Writer, f Attr, indent string) {
	previousText := false

	// section marks the start of a new section of the comment;
	// sections are separated with empty lines.
	section := func() {
		if previousText {
			fmt.Fprintf(w, "%s\n", strings.TrimRightFunc(indent, unicode.IsSpace))
		}
		previousText = true
	}

	descr := strings.TrimSpace(f.Description)
	if descr != "" {
		section()
		doc.ToText(w, descr, indent, "    ", textWidth-len(indent))
	}
	vars := make([]string, 0, len(f.EnvVars)+1)
	if f.EnvVar != "" {
		vars = append(vars, "$"+f.EnvVar)
	}
	for _, v := range f.EnvVars {
		vars = append(vars, "$"+v)
	}
	if len(vars) > 0 {
		section()
		fmt.Fprintf(w, "%sDefault value taken from %s.\n", indent, wordyList(vars))
	}
	attrText := ""
	switch {
	case f.Secret && f.Immutable:
		attrText = "immutable and considered secret"
	case f.Secret:
		attrText = "considered secret"
	case f.Immutable:
		attrText = "immutable"
	}
	if attrText != "" {
		section()
		fmt.Fprintf(w, "%sThis attribute is %s.\n", indent, attrText)
	}
	section()
}
// writeSampleDescription writes the given attribute to w
// prefixed by the given indentation string.
writeSampleDescription writes the given attribute to w
prefixed by the given indentation string.
// writeSampleDescription writes the given attribute to w // prefixed by the given indentation string .
func writeSampleDescription(w io.Writer, f Attr, indent string) {
	previousText := false
	section := func() {
		if previousText {
			fmt.Fprintf(w, "%s\n", strings.TrimRightFunc(indent, unicode.IsSpace))
		}
		previousText = true
	}
	descr := strings.TrimSpace(f.Description)
	if descr != "" {
		section()
		doc.ToText(w, descr, indent, "    ", textWidth-len(indent))
	}
	vars := make([]string, 0, len(f.EnvVars)+1)
	if f.EnvVar != "" {
		vars = append(vars, "$"+f.EnvVar)
	}
	for _, v := range f.EnvVars {
		vars = append(vars, "$"+v)
	}
	if len(vars) > 0 {
		section()
		fmt.Fprintf(w, "%sDefault value taken from %s.\n", indent, wordyList(vars))
	}
	attrText := ""
	switch {
	case f.Secret && f.Immutable:
		attrText = "immutable and considered secret"
	case f.Secret:
		attrText = "considered secret"
	case f.Immutable:
		attrText = "immutable"
	}
	if attrText != "" {
		section()
		fmt.Fprintf(w, "%sThis attribute is %s.\n", indent, attrText)
	}
	section()
}
func writeSampleDescription ( w io . Writer , f Attr , indent string ) { previousText := false section := func ( ) { if previousText { fmt . Fprintf ( w , " \n " , strings . TrimRightFunc ( indent , unicode . IsSpace ) ) } previousText = true } descr := strings . TrimSpace ( f . Description ) if descr != " " { section ( ) doc . ToText ( w , descr , indent , " " , textWidth - len ( indent ) ) } vars := make ( [ ] string , 0 , len ( f . EnvVars ) + 1 ) if f . EnvVar != " " { vars = append ( vars , " " + f . EnvVar ) } for _ , v := range f . EnvVars { vars = append ( vars , " " + v ) } if len ( vars ) > 0 { section ( ) fmt . Fprintf ( w , " \n " , indent , wordyList ( vars ) ) } attrText := " " switch { case f . Secret && f . Immutable : attrText = " " case f . Secret : attrText = " " case f . Immutable : attrText = " " } if attrText != " " { section ( ) fmt . Fprintf ( w , " \n " , indent , attrText ) } section ( ) }
writeSampleDescription writes the given attribute to w
prefixed by the given indentation string.
writeSampleDescription writes the given attribute to w prefixed by the given indentation string .
// section marks the start of a new section of the comment; // sections are separated with empty lines.