Skip to content

Commit

Permalink
更新action和移除低版本不支持的io.ReadAll函数
Browse files Browse the repository at this point in the history
  • Loading branch information
guonaihong committed Jul 13, 2023
1 parent 4033ad9 commit b96a594
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/go.yml
Expand Up @@ -7,14 +7,18 @@ on:
jobs:

build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.15', '1.16', '1.17', '1.18', '1.19', '1.20']
name: Go ${{ matrix.go }} sample

steps:

- name: Set up Go 1.14
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.14
go-version: ${{ matrix.go }}
id: go

- name: Check out code into the Go module directory
Expand Down
5 changes: 2 additions & 3 deletions hcutil/hcutil_test.go
Expand Up @@ -3,7 +3,6 @@ package hcutil
import (
"context"
"errors"
"io"
"io/ioutil"
"net"
"net/http"
Expand Down Expand Up @@ -84,7 +83,7 @@ func TestProxy(t *testing.T) {
resp, err := c.Do(req)
assert.NoError(t, err)

res, err := io.ReadAll(resp.Body)
res, err := ioutil.ReadAll(resp.Body)
assert.NoError(t, err)

s = string(res)
Expand Down Expand Up @@ -129,7 +128,7 @@ func TestUnixSocket(t *testing.T) {
resp, err := c.Do(req)

assert.NoError(t, err)
all, err := io.ReadAll(resp.Body)
all, err := ioutil.ReadAll(resp.Body)
assert.NoError(t, err)
s = string(all)

Expand Down

0 comments on commit b96a594

Please sign in to comment.