Skip to content

Commit

Permalink
Bump golang to v1.20, fixes ddev#4443 (ddev#4639)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay authored Feb 11, 2023
1 parent bfa0407 commit 3dbe7fc
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .ci-scripts/linux_arm64_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o errexit
# Basic tools

set -x
export GO_VERSION=1.19.4
export GO_VERSION=1.20

if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then
set +x
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/colima-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.19.4'
go-version: '>=1.20'

- name: Homebrew cache/restore
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.19.4'
go-version: '>=1.20'

- name: Build and test container ${{ matrix.containers }}
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.4'
go-version: '>=1.20'
- uses: actions/checkout@v3
- run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.50
version: latest

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.19.4'
go-version: '>=1.20'

- name: Build DDEV executables
run: make linux_amd64 linux_arm64 darwin_amd64 darwin_arm64 completions mkcert
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.4'
go-version: '>=1.20'

- name: restore build-most results from cache
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '>=1.19.4'
go-version: '>=1.20'

- name: Build DDEV executables
run: make linux_amd64 linux_arm64 darwin_amd64 darwin_arm64 windows_amd64 windows_install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
run: ./.github/workflows/linux-setup.sh
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.4'
go-version: '>=1.20'

- name: Override environment variables for push-pull-test-platforms
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitpod/images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN pip3 install mkdocs pyspelling pymdown-extensions
RUN npm install -g markdownlint-cli
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v1.50.0

RUN rm -rf /usr/local/go && curl -sL -o /tmp/go.tar.gz https://go.dev/dl/go1.19.2.linux-amd64.tar.gz && tar -C /usr/local -xzf /tmp/go.tar.gz && rm /tmp/go.tar.gz && ln -s /usr/local/go/bin/go /usr/local/bin/go
RUN rm -rf /usr/local/go && curl -sL -o /tmp/go.tar.gz https://go.dev/dl/go1.20.linux-amd64.tar.gz && tar -C /usr/local -xzf /tmp/go.tar.gz && rm /tmp/go.tar.gz && ln -s /usr/local/go/bin/go /usr/local/bin/go

USER gitpod

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ $(TARGETS): mkcert $(GOFILES)
@echo "building $@ from $(SRC_AND_UNDER)";
@#echo "LDFLAGS=$(LDFLAGS)";
@rm -f $@
@export TARGET=$(word 3, $(subst /, ,$@)) && \
export TARGET=$(word 3, $(subst /, ,$@)) && \
export GOOS="$${TARGET%_*}" GOARCH="$${TARGET#*_}" CGO_ENABLED=0 GOPATH="$(PWD)/$(GOTMP)" GOCACHE="$(PWD)/$(GOTMP)/.cache" && \
mkdir -p $(GOTMP)/{.cache,pkg,src,bin/$$TARGET} && \
chmod 777 $(GOTMP)/{.cache,pkg,src,bin/$$TARGET} && \
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
)

go 1.19
go 1.20
2 changes: 0 additions & 2 deletions pkg/archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,6 @@ func Untar(source string, dest string, extractionDir string) error {
}

case tar.TypeReg:
fallthrough
case tar.TypeRegA:
// Always ensure the directory is created before trying to move the file.
fullPathDir := filepath.Dir(fullPath)
err = os.MkdirAll(fullPathDir, 0755)
Expand Down
2 changes: 1 addition & 1 deletion pkg/fileutil/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package fileutil

import (
"bytes"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
"io/fs"
"math/rand"
"os"
"path/filepath"
"regexp"
Expand Down
4 changes: 0 additions & 4 deletions pkg/util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ import (
"github.com/drud/ddev/pkg/output"
)

func init() {
rand.Seed(time.Now().UnixNano())
}

// Failed will print a red error message and exit with failure.
func Failed(format string, a ...interface{}) {
format = ColorizeText(format, "red")
Expand Down

0 comments on commit 3dbe7fc

Please sign in to comment.