From 65adda8feb82ecdfd8b75947f5db66acbbfdba05 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Sat, 20 Jan 2024 01:00:21 -0500 Subject: [PATCH] sort with key/values Signed-off-by: Jason Hall --- pkg/build/pipeline.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/build/pipeline.go b/pkg/build/pipeline.go index 81b84709b..6ffb45c7b 100644 --- a/pkg/build/pipeline.go +++ b/pkg/build/pipeline.go @@ -20,11 +20,13 @@ import ( "fmt" "os" "path/filepath" + "sort" "strconv" "strings" "github.com/chainguard-dev/clog" "go.opentelemetry.io/otel" + "golang.org/x/exp/maps" "gopkg.in/yaml.v3" @@ -268,8 +270,10 @@ func (pctx *PipelineContext) loadUse(ctx context.Context, pb *PipelineBuild, use func (pctx *PipelineContext) dumpWith(ctx context.Context) { log := clog.FromContext(ctx) - for k, v := range pctx.Pipeline.With { - log.Debug(" " + k + ": " + v) + ks := maps.Keys(pctx.Pipeline.With) + sort.Strings(ks) + for _, k := range ks { + log.Debugf(" %s: %s", k, pctx.Pipeline.With[k]) } }