From b74994de4a152b53abefd4feea24a3ddf1169e6e Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 19 Jul 2019 14:41:30 +0200 Subject: [PATCH] Simplify boolean comparison / return A bit more readable, in my opinion. --- actions.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/actions.go b/actions.go index aa4fc75..bff77df 100644 --- a/actions.go +++ b/actions.go @@ -109,10 +109,7 @@ func (s *shellActionsImpl) ReadMultiLinesFunc(f func(string) bool) string { func (s *shellActionsImpl) ReadMultiLines(terminator string) string { return s.ReadMultiLinesFunc(func(line string) bool { - if strings.HasSuffix(strings.TrimSpace(line), terminator) { - return false - } - return true + return !strings.HasSuffix(strings.TrimSpace(line), terminator) }) }