Skip to content

Commit 383d750

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]>
1 parent 39b6ba8 commit 383d750

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
@@ -367,6 +367,7 @@ func checkLabels(ctx context.Context, t *testing.T, cs content.Store) {
367367
labels := map[string]string{
368368
"k1": "v1",
369369
"k2": "v2",
370+
370371
"containerd.io/gc.root": rootTime,
371372
}
372373

@@ -403,6 +404,7 @@ func checkLabels(ctx context.Context, t *testing.T, cs content.Store) {
403404

404405
info.Labels = map[string]string{
405406
"k1": "v1",
407+
406408
"containerd.io/gc.root": rootTime,
407409
}
408410
preUpdate = time.Now()

snapshots/testsuite/testsuite.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ func checkUpdate(ctx context.Context, t *testing.T, snapshotter snapshots.Snapsh
684684
expected = map[string]string{
685685
"l1": "updated",
686686
"l3": "v3",
687+
687688
"containerd.io/gc.root": rootTime,
688689
}
689690
st.Labels = map[string]string{
@@ -698,6 +699,7 @@ func checkUpdate(ctx context.Context, t *testing.T, snapshotter snapshots.Snapsh
698699

699700
expected = map[string]string{
700701
"l4": "v4",
702+
701703
"containerd.io/gc.root": rootTime,
702704
}
703705
st.Labels = expected

0 commit comments

Comments
 (0)