aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/config
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-11-29 18:01:24 +0100
committerGitHub <noreply@github.com>2017-11-29 18:01:24 +0100
commit7ced03216a47327d64f68c750114a96cfcbae38b (patch)
treea797b79d0a750972ba9809eb52691cb09f9b6383 /plumbing/format/config
parentc07c778ed043429427533e2fd7549a3d54b903f1 (diff)
parent18e6f9daa3899318d36b525b068837f49bc2c1cf (diff)
downloadgo-git-7ced03216a47327d64f68c750114a96cfcbae38b.tar.gz
Merge pull request #667 from ferhatelmas/simplify
all: simplification
Diffstat (limited to 'plumbing/format/config')
-rw-r--r--plumbing/format/config/encoder.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/plumbing/format/config/encoder.go b/plumbing/format/config/encoder.go
index 6d17a5a..4eac896 100644
--- a/plumbing/format/config/encoder.go
+++ b/plumbing/format/config/encoder.go
@@ -53,17 +53,13 @@ func (e *Encoder) encodeSubsection(sectionName string, s *Subsection) error {
return err
}
- if err := e.encodeOptions(s.Options); err != nil {
- return err
- }
-
- return nil
+ return e.encodeOptions(s.Options)
}
func (e *Encoder) encodeOptions(opts Options) error {
for _, o := range opts {
pattern := "\t%s = %s\n"
- if strings.Index(o.Value, "\\") != -1 {
+ if strings.Contains(o.Value, "\\") {
pattern = "\t%s = %q\n"
}