From 7eb943e70aa5d526ad61d6a6ab576ef01bcf29c8 Mon Sep 17 00:00:00 2001 From: Eason Lin Date: Fri, 7 Jul 2017 08:43:47 +0800 Subject: [PATCH] Use single line (#985) --- utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils.go b/utils.go index 18064fb5..968570c7 100644 --- a/utils.go +++ b/utils.go @@ -100,12 +100,10 @@ func parseAccept(acceptHeader string) []string { parts := strings.Split(acceptHeader, ",") out := make([]string, 0, len(parts)) for _, part := range parts { - index := strings.IndexByte(part, ';') - if index >= 0 { + if index := strings.IndexByte(part, ';'); index >= 0 { part = part[0:index] } - part = strings.TrimSpace(part) - if len(part) > 0 { + if part = strings.TrimSpace(part); len(part) > 0 { out = append(out, part) } }