From bfe45eef34bfad73dc9c5255ac8f06ae19501554 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 21 Jul 2019 06:15:34 +0200 Subject: plumbing/format: simplify code Just a bit easier to read, in my opinion. Signed-off-by: Christian Muehlhaeuser (cherry picked from commit 91d314ce8f13eff06fd4af8b869cee5a3e2ab014) --- plumbing/format/diff/unified_encoder.go | 2 +- plumbing/format/gitattributes/pattern.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'plumbing/format') diff --git a/plumbing/format/diff/unified_encoder.go b/plumbing/format/diff/unified_encoder.go index 8bd6d8a..169242d 100644 --- a/plumbing/format/diff/unified_encoder.go +++ b/plumbing/format/diff/unified_encoder.go @@ -94,7 +94,7 @@ func (e *UnifiedEncoder) printMessage(message string) { isEmpty := message == "" hasSuffix := strings.HasSuffix(message, "\n") if !isEmpty && !hasSuffix { - message = message + "\n" + message += "\n" } e.buf.WriteString(message) diff --git a/plumbing/format/gitattributes/pattern.go b/plumbing/format/gitattributes/pattern.go index c5ca0c7..d961aba 100644 --- a/plumbing/format/gitattributes/pattern.go +++ b/plumbing/format/gitattributes/pattern.go @@ -66,7 +66,7 @@ func (p *pattern) Match(path []string) bool { doublestar = true } - switch true { + switch { case strings.Contains(pattern[0], "**"): return false -- cgit