Skip to content

Commit 0fc64b6

Browse files
committed
Workaround for gofmt change in Go 1.11
Go 1.11 uses a different formatting for maps, and now aligns values; running `gofmt -s -w` on this file resulted in this diff; ```patch content/testsuite/testsuite.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/testsuite/testsuite.go b/content/testsuite/testsuite.go index 974c7cb..d9ae9dc160 100644 --- a/content/testsuite/testsuite.go +++ b/content/testsuite/testsuite.go @@ -365,8 +365,8 @@ func checkLabels(ctx context.Context, t *testing.T, cs content.Store) { rootTime := time.Now().UTC().Format(time.RFC3339) labels := map[string]string{ - "k1": "v1", - "k2": "v2", + "k1": "v1", + "k2": "v2", "containerd.io/gc.root": rootTime, } @@ -402,7 +402,7 @@ func checkLabels(ctx context.Context, t *testing.T, cs content.Store) { } info.Labels = map[string]string{ - "k1": "v1", + "k1": "v1", "containerd.io/gc.root": rootTime, } preUpdate = time.Now() ``` Adding a whitespace before the long key to make it format the same on both Go 1.11 and older versions of Go. Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 383d750) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 45b8d86 commit 0fc64b6

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

content/testsuite/testsuite.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ func checkLabels(ctx context.Context, t *testing.T, cs content.Store) {
401401
labels := map[string]string{
402402
"k1": "v1",
403403
"k2": "v2",
404+
404405
"containerd.io/gc.root": rootTime,
405406
}
406407

@@ -437,6 +438,7 @@ func checkLabels(ctx context.Context, t *testing.T, cs content.Store) {
437438

438439
info.Labels = map[string]string{
439440
"k1": "v1",
441+
440442
"containerd.io/gc.root": rootTime,
441443
}
442444
preUpdate = time.Now()

snapshots/testsuite/testsuite.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ func checkUpdate(ctx context.Context, t *testing.T, snapshotter snapshots.Snapsh
687687
expected = map[string]string{
688688
"l1": "updated",
689689
"l3": "v3",
690+
690691
"containerd.io/gc.root": rootTime,
691692
}
692693
st.Labels = map[string]string{
@@ -701,6 +702,7 @@ func checkUpdate(ctx context.Context, t *testing.T, snapshotter snapshots.Snapsh
701702

702703
expected = map[string]string{
703704
"l4": "v4",
705+
704706
"containerd.io/gc.root": rootTime,
705707
}
706708
st.Labels = expected

0 commit comments

Comments
 (0)