RemoveSubsection removes a subsection from a Section.
(name string)
| 92 | |
| 93 | // RemoveSubsection removes a subsection from a Section. |
| 94 | func (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. |