makeDefinedSection duplicates sections from overrides, and prints it once for each override.
(defs Defs, order []section, showValue bool)
| 105 | |
| 106 | // makeDefinedSection duplicates sections from overrides, and prints it once for each override. |
| 107 | func (h *Header) makeDefinedSection(defs Defs, order []section, showValue bool) string { |
| 108 | var buf bytes.Buffer |
| 109 | |
| 110 | for _, section := range order { |
| 111 | newHeader := createDefinedSection(defs[section], h, section) |
| 112 | // Make a brand new section and pass it back in. |
| 113 | // Only defined sections can comment the header. |
| 114 | buf.WriteString(newHeader.makeSection(section, !defs[section].Comment, showValue)) |
| 115 | } |
| 116 | |
| 117 | return buf.String() |
| 118 | } |
no test coverage detected