MCPcopy Create free account
hub / github.com/go-git/go-git / RemoveSubsection

Method RemoveSubsection

plumbing/format/config/section.go:94–104  ·  view source on GitHub ↗

RemoveSubsection removes a subsection from a Section.

(name string)

Source from the content-addressed store, hash-verified

92
93// RemoveSubsection removes a subsection from a Section.
94func (s *Section) RemoveSubsection(name string) *Section {
95 result := Subsections{}
96 for _, s := range s.Subsections {
97 if !s.IsName(name) {
98 result = append(result, s)
99 }
100 }
101
102 s.Subsections = result
103 return s
104}
105
106// Option returns the value for the specified key. Empty string is returned if
107// key does not exists.

Callers 1

Calls 1

IsNameMethod · 0.95

Tested by 1