From 1bf6f19716f4053308fa14fff39e41ebc8e99271 Mon Sep 17 00:00:00 2001 From: Vinay P Date: Thu, 2 Jul 2020 07:18:53 +0100 Subject: [PATCH] Keep bool fields together in context struct defn Based on feedback from PR: > Putting all the bool fields consecutively at the end avoids padding bytes in the middle of the struct that the compiler will add to maintain the alignment requirements of the bigger slice fields. --- log/log.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/log/log.go b/log/log.go index 9241be3c8..4c0af6e7d 100644 --- a/log/log.go +++ b/log/log.go @@ -133,9 +133,8 @@ func WithSuffix(logger Logger, keyvals ...interface{}) Logger { type context struct { logger Logger keyvals []interface{} + sKeyvals []interface{} // suffixes hasValuer bool - // suffixes - sKeyvals []interface{} sHasValuer bool }