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

Method encodeSection

plumbing/format/config/encoder.go:34–52  ·  view source on GitHub ↗
(s *Section)

Source from the content-addressed store, hash-verified

32}
33
34func (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
54func (e *Encoder) encodeSubsection(sectionName string, s *Subsection) error {
55 if err := e.printf("[%s \"%s\"]\n", sectionName, subsectionReplacer.Replace(s.Name)); err != nil {

Callers 1

EncodeMethod · 0.95

Calls 3

printfMethod · 0.95
encodeOptionsMethod · 0.95
encodeSubsectionMethod · 0.95

Tested by

no test coverage detected