From 0db7b9f774d980cb2aba6e9bb2b6e8fd09d6ac77 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 16 Jul 2025 13:50:31 +0200 Subject: [PATCH] cli/command/container: newDiffContext: use struct-literal Signed-off-by: Sebastiaan van Stijn --- cli/command/container/formatter_diff.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/command/container/formatter_diff.go b/cli/command/container/formatter_diff.go index 45c45da9b3..0d74e42607 100644 --- a/cli/command/container/formatter_diff.go +++ b/cli/command/container/formatter_diff.go @@ -45,12 +45,14 @@ type diffContext struct { } func newDiffContext() *diffContext { - diffCtx := diffContext{} - diffCtx.Header = formatter.SubHeaderContext{ - "Type": changeTypeHeader, - "Path": pathHeader, + return &diffContext{ + HeaderContext: formatter.HeaderContext{ + Header: formatter.SubHeaderContext{ + "Type": changeTypeHeader, + "Path": pathHeader, + }, + }, } - return &diffCtx } func (d *diffContext) MarshalJSON() ([]byte, error) {