Repository: moby/moby (language: go)

Issue:
[23.0 backport] Upgrade to Go 1.20.1
- v23.0 backport of #44620

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/moby/moby/blob/master/CONTRIBUTING.md

** Make sure all your commits include a signature generated with `git commit -s` **

For additional information on our contributing process, read our contributing
guide https://docs.docker.com/opensource/code/

If this is a bug fix, make sure your description includes "fixes #xxxx", or
"closes #xxxx"

Please provide the following information:
-->

**- What I did**

**- How I did it**

**- How to verify it**

**- Description for the changelog**
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->


**- A picture of a cute animal (not mandatory but encouraged)**




Discussion / hints:

Fix patch:
diff --git a/.github/workflows/.windows.yml b/.github/workflows/.windows.yml
index 14d82d50635ae..6d1541c85362c 100644
--- a/.github/workflows/.windows.yml
+++ b/.github/workflows/.windows.yml
@@ -15,7 +15,7 @@ on:
         default: false
 
 env:
-  GO_VERSION: 1.19.10
+  GO_VERSION: "1.20.5"
   GOTESTLIST_VERSION: v0.3.1
   TESTSTAT_VERSION: v0.1.3
   WINDOWS_BASE_IMAGE: mcr.microsoft.com/windows/servercore
diff --git a/Dockerfile b/Dockerfile
index 3573f0270b0ea..5c4367632786f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
 # syntax=docker/dockerfile:1
 
-ARG GO_VERSION=1.19.10
+ARG GO_VERSION=1.20.5
 ARG BASE_DEBIAN_DISTRO="bullseye"
 ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
 ARG XX_VERSION=1.2.1
diff --git a/Dockerfile.simple b/Dockerfile.simple
index d8af8f57358f9..0431db9b80b20 100644
--- a/Dockerfile.simple
+++ b/Dockerfile.simple
@@ -5,7 +5,7 @@
 
 # This represents the bare minimum required to build and test Docker.
 
-ARG GO_VERSION=1.19.10
+ARG GO_VERSION=1.20.5
 
 ARG BASE_DEBIAN_DISTRO="bullseye"
 ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
diff --git a/Dockerfile.windows b/Dockerfile.windows
index 7cb443af152bc..7a2f2ca227fb2 100644
--- a/Dockerfile.windows
+++ b/Dockerfile.windows
@@ -165,7 +165,7 @@ FROM microsoft/windowsservercore
 # Use PowerShell as the default shell
 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
 
-ARG GO_VERSION=1.19.10
+ARG GO_VERSION=1.20.5
 ARG GOTESTSUM_VERSION=v1.8.2
 ARG GOWINRES_VERSION=v0.3.0
 ARG CONTAINERD_VERSION=v1.6.21
diff --git a/hack/with-go-mod.sh b/hack/with-go-mod.sh
index 911eb3b50bc95..3be44d11ec8f4 100755
--- a/hack/with-go-mod.sh
+++ b/hack/with-go-mod.sh
@@ -23,7 +23,7 @@ else
 	tee "${ROOTDIR}/go.mod" >&2 <<- EOF
 		module github.com/docker/docker
 
-		go 1.18
+		go 1.19
 	EOF
 	trap 'rm -f "${ROOTDIR}/go.mod"' EXIT
 fi


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index ad77d46bb58e5..6556709203bba 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -15,7 +15,7 @@ on:
   pull_request:
 
 env:
-  GO_VERSION: 1.19.10
+  GO_VERSION: "1.20.5"
   GOTESTLIST_VERSION: v0.3.1
   TESTSTAT_VERSION: v0.1.3
   ITG_CLI_MATRIX_SIZE: 6
diff --git a/Dockerfile.e2e b/Dockerfile.e2e
index cf7a2cd99d9cd..b4f16feb25c17 100644
--- a/Dockerfile.e2e
+++ b/Dockerfile.e2e
@@ -1,4 +1,4 @@
-ARG GO_VERSION=1.19.10
+ARG GO_VERSION=1.20.5
 
 FROM golang:${GO_VERSION}-alpine AS base
 ENV GO111MODULE=off