(s *Section)
| 32 | } |
| 33 | |
| 34 | func (e *Encoder) encodeSection(s *Section) error { |
| 35 | if len(s.Options) > 0 { |
| 36 | if err := e.printf("[%s]\n", s.Name); err != nil { |
| 37 | return err |
| 38 | } |
| 39 | |
| 40 | if err := e.encodeOptions(s.Options); err != nil { |
| 41 | return err |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | for _, ss := range s.Subsections { |
| 46 | if err := e.encodeSubsection(s.Name, ss); err != nil { |
| 47 | return err |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | return nil |
| 52 | } |
| 53 | |
| 54 | func (e *Encoder) encodeSubsection(sectionName string, s *Subsection) error { |
| 55 | if err := e.printf("[%s \"%s\"]\n", sectionName, subsectionReplacer.Replace(s.Name)); err != nil { |
no test coverage detected