MCPcopy Create free account
hub / github.com/Unpackerr/unpackerr / makeDefinedSection

Method makeDefinedSection

init/config/config.go:107–118  ·  view source on GitHub ↗

makeDefinedSection duplicates sections from overrides, and prints it once for each override.

(defs Defs, order []section, showValue bool)

Source from the content-addressed store, hash-verified

105
106// makeDefinedSection duplicates sections from overrides, and prints it once for each override.
107func (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}

Callers 1

createConfFileFunction · 0.80

Calls 3

createDefinedSectionFunction · 0.85
makeSectionMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected