Use Go 1.22 to build and test (#1562)

## Changes

This has been released for a while. Blog post:
https://go.dev/blog/go1.22.

## Tests

None besides the unit tests.
This commit is contained in:
Pieter Noordhuis 2024-07-04 08:54:41 +02:00 committed by GitHub
parent 324fa2e18b
commit 80136dea5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 9 deletions

View File

@ -33,7 +33,7 @@ jobs:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: 1.21.x go-version: 1.22.x
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
@ -68,7 +68,7 @@ jobs:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: 1.21.x go-version: 1.22.x
# No need to download cached dependencies when running gofmt. # No need to download cached dependencies when running gofmt.
cache: false cache: false
@ -100,7 +100,7 @@ jobs:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: 1.21.x go-version: 1.22.x
# Github repo: https://github.com/ajv-validator/ajv-cli # Github repo: https://github.com/ajv-validator/ajv-cli
- name: Install ajv-cli - name: Install ajv-cli

View File

@ -21,7 +21,7 @@ jobs:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: 1.21.x go-version: 1.22.x
- name: Hide snapshot tag to outsmart GoReleaser - name: Hide snapshot tag to outsmart GoReleaser
run: git tag -d snapshot || true run: git tag -d snapshot || true

View File

@ -22,7 +22,7 @@ jobs:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: 1.21.x go-version: 1.22.x
# Log into the GitHub Container Registry. The goreleaser action will create # Log into the GitHub Container Registry. The goreleaser action will create
# the docker images and push them to the GitHub Container Registry. # the docker images and push them to the GitHub Container Registry.

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/databricks/cli module github.com/databricks/cli
go 1.21 go 1.22
require ( require (
github.com/Masterminds/semver/v3 v3.2.1 // MIT github.com/Masterminds/semver/v3 v3.2.1 // MIT

View File

@ -5,7 +5,6 @@ import (
"bytes" "bytes"
"context" "context"
"fmt" "fmt"
"os"
"os/exec" "os/exec"
"strings" "strings"
"testing" "testing"
@ -26,8 +25,8 @@ func splitLines(b []byte) (lines []string) {
func TestBackgroundUnwrapsNotFound(t *testing.T) { func TestBackgroundUnwrapsNotFound(t *testing.T) {
ctx := context.Background() ctx := context.Background()
_, err := Background(ctx, []string{"/bin/meeecho", "1"}) _, err := Background(ctx, []string{"meeecho", "1"})
assert.ErrorIs(t, err, os.ErrNotExist) assert.ErrorIs(t, err, exec.ErrNotFound)
} }
func TestBackground(t *testing.T) { func TestBackground(t *testing.T) {