Skip to content

Commit

Permalink
Require go1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed May 17, 2022
1 parent 117e7a3 commit b2359d5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/unit.yml
Expand Up @@ -39,11 +39,7 @@ jobs:
- 'windows-latest'
- 'macos-latest'
go:
- '1.13'
- '1.14'
- '1.15'
- '1.16'
- '1.17'
- '1.18'

runs-on: '${{ matrix.os }}'

Expand Down
3 changes: 1 addition & 2 deletions actions.go
Expand Up @@ -23,7 +23,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -391,7 +390,7 @@ func (c *Action) GetIDToken(ctx context.Context, audience string) (string, error

// This has moved to the io package in Go 1.16, but we still support up to Go
// 1.13 for now.
body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 64*1000))
body, err := io.ReadAll(io.LimitReader(resp.Body, 64*1000))
if err != nil {
return "", fmt.Errorf("failed to read response body: %w", err)
}
Expand Down
14 changes: 7 additions & 7 deletions actions_test.go
Expand Up @@ -18,7 +18,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"os"
Expand Down Expand Up @@ -71,7 +71,7 @@ func TestAction_IssueCommand(t *testing.T) {
func TestAction_IssueFileCommand(t *testing.T) {
t.Parallel()

file, err := ioutil.TempFile("", "")
file, err := os.CreateTemp("", "")
if err != nil {
t.Fatalf("unable to create a temp env file: %s", err)
}
Expand All @@ -95,7 +95,7 @@ func TestAction_IssueFileCommand(t *testing.T) {
}

// expect the message to be written to the env file
data, err := ioutil.ReadFile(file.Name())
data, err := os.ReadFile(file.Name())
if err != nil {
t.Errorf("unable to read temp env file: %s", err)
}
Expand Down Expand Up @@ -147,7 +147,7 @@ func TestAction_AddPath(t *testing.T) {
const envGitHubPath = "GITHUB_PATH"

// expect a file command to be issued when env file is set.
file, err := ioutil.TempFile("", "")
file, err := os.CreateTemp("", "")
if err != nil {
t.Fatalf("unable to create a temp env file: %s", err)
}
Expand All @@ -169,7 +169,7 @@ func TestAction_AddPath(t *testing.T) {
}

// expect the message to be written to the file.
data, err := ioutil.ReadAll(file)
data, err := io.ReadAll(file)
if err != nil {
t.Errorf("unable to read temp env file: %s", err)
}
Expand Down Expand Up @@ -234,7 +234,7 @@ func TestAction_SetEnv(t *testing.T) {

// expectations for env file env commands
var b bytes.Buffer
file, err := ioutil.TempFile("", "")
file, err := os.CreateTemp("", "")
if err != nil {
t.Fatalf("unable to create a temp env file: %s", err)
}
Expand All @@ -251,7 +251,7 @@ func TestAction_SetEnv(t *testing.T) {
}

// expect the command to be written to the file.
data, err := ioutil.ReadAll(file)
data, err := io.ReadAll(file)
if err != nil {
t.Errorf("unable to read temp env file: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -14,4 +14,4 @@

module github.com/sethvargo/go-githubactions

go 1.13
go 1.18

0 comments on commit b2359d5

Please sign in to comment.