Skip to content

Commit

Permalink
Merge pull request #33 from gailazar300/upgrade-go-1.19
Browse files Browse the repository at this point in the history
Upgrade GO to 1.19
  • Loading branch information
gailazar300 authored Nov 7, 2022
2 parents 8c7b69d + 6c4eca7 commit a4c9225
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.19.x
- name: Static Code Analysis
uses: dominikh/staticcheck-action@v1
with:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.19.x
- name: Install gosec
run: curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
- name: Run gosec
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/frogbot-fix-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.19.x

- uses: jfrog/frogbot@v2
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/frogbot-scan-pr-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.19.x

- uses: jfrog/frogbot@v2
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.19.x

- name: Go Cache
uses: actions/cache@v3
Expand Down
7 changes: 3 additions & 4 deletions fanout/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"encoding/hex"
"errors"
"io"
"io/ioutil"
"strings"
"testing"
)
Expand Down Expand Up @@ -83,7 +82,7 @@ func TestFanoutProgressiveRead(t *testing.T) {
r := bytes.NewReader(inputBytes)
pfr := NewReader(r, ConsumerFunc(proc1), ConsumerFunc(proc2))

_, err := ioutil.ReadAll(pfr)
_, err := io.ReadAll(pfr)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -119,7 +118,7 @@ func TestFanoutProgressiveReadError(t *testing.T) {
r := bytes.NewReader(inputBytes)
pfr := NewReader(r, ConsumerFunc(proc1), ConsumerFunc(proc2))

_, err := ioutil.ReadAll(pfr)
_, err := io.ReadAll(pfr)
if err == nil {
t.Fatal("Expected a non-nil error")
}
Expand All @@ -145,7 +144,7 @@ func TestFanoutProgressiveReadError(t *testing.T) {
// This scenario can cause deadlock
func TestSyncReadOnError(t *testing.T) {
proc1 := func(r1 io.Reader) (interface{}, error) {
n, e := ioutil.ReadAll(r1)
n, e := io.ReadAll(r1)
return n, e
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/jfrog/gofrog

go 1.18
go 1.19

require (
github.com/pkg/errors v0.9.1
Expand Down
3 changes: 1 addition & 2 deletions io/fileutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
cr "crypto/rand"
"errors"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
Expand All @@ -26,7 +25,7 @@ var src = rand.NewSource(time.Now().UnixNano())
var rnd = rand.New(src)

func CreateRandomLenFile(maxLen int, filesDir string, prefix string) string {
file, _ := ioutil.TempFile(filesDir, prefix)
file, _ := os.CreateTemp(filesDir, prefix)
fname := file.Name()
len := rnd.Intn(maxLen)
created, err := CreateRandFile(fname, len)
Expand Down

0 comments on commit a4c9225

Please sign in to comment.