Skip to content

Commit

Permalink
Merge pull request #46696 from corhere/backport-20.10/go1.20-enablement
Browse files Browse the repository at this point in the history
[20.10 backport] Go 1.20 Enablement
  • Loading branch information
corhere committed Oct 23, 2023
2 parents ea4eb73 + 79d5066 commit cb47414
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions daemon/daemon_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ func TestVerifyPlatformContainerResources(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
warnings, err := verifyPlatformContainerResources(&tc.resources, &tc.sysInfo, tc.update)
Expand Down
2 changes: 1 addition & 1 deletion daemon/logger/awslogs/cloudwatchlogs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ func TestCollectBatchWithDuplicateTimestamps(t *testing.T) {
for i := 0; i < times; i++ {
line := fmt.Sprintf("%d", i)
if i%2 == 0 {
timestamp.Add(1 * time.Nanosecond)
timestamp = timestamp.Add(1 * time.Nanosecond)
}
stream.Log(&logger.Message{
Line: []byte(line),
Expand Down
3 changes: 2 additions & 1 deletion distribution/xfer/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func TestMaxDownloadAttempts(t *testing.T) {
name: "max-attempts=5, fail at 6th attempt",
simulateRetries: 6,
maxDownloadAttempts: 5,
expectedErr: "simulating download attempt 5/6",
expectedErr: "simulating download attempt 6/6",
},
{
name: "max-attempts=0, fail after 1 attempt",
Expand All @@ -392,6 +392,7 @@ func TestMaxDownloadAttempts(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
layerStore := &mockLayerStore{make(map[layer.ChainID]*mockLayer)}
Expand Down
2 changes: 1 addition & 1 deletion hack/dockerfile/install/golangci_lint.installer
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

: "${GOLANGCI_LINT_VERSION=v1.49.0}"
: "${GOLANGCI_LINT_VERSION=v1.51.2}"

install_golangci_lint() {
set -e
Expand Down
1 change: 1 addition & 0 deletions integration/build/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func TestBuildWithRemoveAndForceRemove(t *testing.T) {
client := testEnv.APIClient()
ctx := context.Background()
for _, c := range cases {
c := c
t.Run(c.name, func(t *testing.T) {
t.Parallel()
dockerfile := []byte(c.dockerfile)
Expand Down
2 changes: 1 addition & 1 deletion integration/container/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ func TestContainerInvalidJSON(t *testing.T) {
defer setupTest(t)()

endpoints := []string{
"/containers/foobar/copy",
"/containers/foobar/exec",
"/exec/foobar/start",
}

for _, ep := range endpoints {
ep := ep
t.Run(ep, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 2 additions & 0 deletions integration/network/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func TestNetworkInvalidJSON(t *testing.T) {
}

for _, ep := range endpoints {
ep := ep
t.Run(ep, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -105,6 +106,7 @@ func TestNetworkList(t *testing.T) {
}

for _, ep := range endpoints {
ep := ep
t.Run(ep, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 1 addition & 0 deletions integration/plugin/common/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestPluginInvalidJSON(t *testing.T) {
endpoints := []string{"/plugins/foobar/set"}

for _, ep := range endpoints {
ep := ep
t.Run(ep, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 1 addition & 0 deletions integration/volume/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func TestVolumesInvalidJSON(t *testing.T) {
endpoints := []string{"/volumes/create"}

for _, ep := range endpoints {
ep := ep
t.Run(ep, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion pkg/archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, L
}
}

case tar.TypeReg, tar.TypeRegA:
case tar.TypeReg:
// Source is regular file. We use system.OpenFileSequential to use sequential
// file access to avoid depleting the standby list on Windows.
// On Linux, this equates to a regular os.OpenFile
Expand Down

0 comments on commit cb47414

Please sign in to comment.