Skip to content

Commit efb5a39

Browse files
authored
Merge pull request #34 from urfave/maint-bumps
Bump dependencies and adapt accordingly
2 parents 52f0d46 + f41d004 commit efb5a39

File tree

8 files changed

+40
-38
lines changed

8 files changed

+40
-38
lines changed

.github/workflows/gfmrun.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Go
2222
uses: actions/setup-go@v3
2323
with:
24-
go-version: 1.18.x
24+
go-version: 1.19.x
2525

2626
- name: Setup Python
2727
uses: actions/setup-python@v3
@@ -39,7 +39,7 @@ jobs:
3939
- name: Run Linter
4040
uses: golangci/golangci-lint-action@v3
4141
with:
42-
version: v1.45.2
42+
version: v1.50.0
4343

4444
- name: Run Test Suite
4545
run: make all

go.mod

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ module github.com/urfave/gfmrun
33
go 1.18
44

55
require (
6-
github.com/sirupsen/logrus v1.8.1
7-
github.com/stretchr/testify v1.2.2
8-
github.com/urfave/cli/v2 v2.5.1
6+
github.com/sirupsen/logrus v1.9.0
7+
github.com/stretchr/testify v1.8.0
8+
github.com/urfave/cli/v2 v2.19.2
99
gopkg.in/yaml.v2 v2.4.0
1010
)
1111

1212
require (
13-
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
13+
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
1414
github.com/davecgh/go-spew v1.1.1 // indirect
1515
github.com/pmezard/go-difflib v1.0.0 // indirect
1616
github.com/russross/blackfriday/v2 v2.1.0 // indirect
17-
golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32 // indirect
17+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
18+
golang.org/x/sys v0.0.0-20221006211917-84dc82d7e875 // indirect
19+
gopkg.in/yaml.v3 v3.0.1 // indirect
1820
)

go.sum

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
2-
github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU=
3-
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
1+
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
2+
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
3+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
44
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
55
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
66
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
77
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
88
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
99
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
10-
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
11-
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
12-
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
13-
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
14-
github.com/urfave/cli/v2 v2.4.0 h1:m2pxjjDFgDxSPtO8WSdbndj17Wu2y8vOT86wE/tjr+I=
15-
github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg=
16-
github.com/urfave/cli/v2 v2.5.1 h1:YKwdkyA0xTBzOaP2G0DVxBnCheHGP+Y9VbKAs4K1Ess=
17-
github.com/urfave/cli/v2 v2.5.1/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs=
18-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
19-
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0=
20-
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
21-
golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32 h1:Js08h5hqB5xyWR789+QqueR6sDE8mk+YvpETZ+F6X9Y=
22-
golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10+
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
11+
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
12+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
13+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
14+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
15+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
16+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
17+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
18+
github.com/urfave/cli/v2 v2.19.2 h1:eXu5089gqqiDQKSnFW+H/FhjrxRGztwSxlTsVK7IuqQ=
19+
github.com/urfave/cli/v2 v2.19.2/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
20+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
21+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
22+
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
23+
golang.org/x/sys v0.0.0-20221006211917-84dc82d7e875 h1:AzgQNqF+FKwyQ5LbVrVqOcuuFB67N47F9+htZYH0wFM=
24+
golang.org/x/sys v0.0.0-20221006211917-84dc82d7e875/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
2325
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2426
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
25-
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2627
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
2728
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
29+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
30+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
31+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

languages.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package gfmrun
33
import (
44
"fmt"
55
"io"
6-
"io/ioutil"
76
"net/http"
87
"os"
98
"path/filepath"
@@ -110,7 +109,7 @@ func LoadLanguages(languagesYml string) (*Languages, error) {
110109
languagesYml = DefaultLanguagesYml
111110
}
112111

113-
rawBytes, err := ioutil.ReadFile(languagesYml)
112+
rawBytes, err := os.ReadFile(languagesYml)
114113
if err != nil {
115114
return nil, err
116115
}
@@ -153,12 +152,12 @@ func PullLanguagesYml(srcURL, destFile string) error {
153152
return fmt.Errorf("fetching %q returned status %v", srcURL, resp.StatusCode)
154153
}
155154

156-
respBodyBytes, err := ioutil.ReadAll(resp.Body)
155+
respBodyBytes, err := io.ReadAll(resp.Body)
157156
if err != nil {
158157
return err
159158
}
160159

161-
outTmp, err := ioutil.TempFile("", "gfmrun-linguist")
160+
outTmp, err := os.CreateTemp("", "gfmrun-linguist")
162161
if err != nil {
163162
_ = outTmp.Close()
164163
return err
@@ -168,7 +167,7 @@ func PullLanguagesYml(srcURL, destFile string) error {
168167

169168
defer func() { _ = os.Remove(outTmp.Name()) }()
170169

171-
err = ioutil.WriteFile(outTmp.Name(), respBodyBytes, os.FileMode(0640))
170+
err = os.WriteFile(outTmp.Name(), respBodyBytes, os.FileMode(0640))
172171
if err != nil {
173172
return err
174173
}

languages_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package gfmrun
22

33
import (
4-
"io/ioutil"
54
"os"
65
"testing"
76

@@ -60,7 +59,7 @@ func TestLanguagesIntegration(t *testing.T) {
6059
t.Skip("integration tests disabled")
6160
}
6261

63-
tf, err := ioutil.TempFile("", "gfmrun-test")
62+
tf, err := os.CreateTemp("", "gfmrun-test")
6463
assert.Nil(t, err)
6564
tf.Close()
6665

package_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package gfmrun
22

33
import (
4-
"io/ioutil"
4+
"io"
55
"os"
66

77
"github.com/sirupsen/logrus"
@@ -14,5 +14,5 @@ var (
1414

1515
func init() {
1616
testLog.Level = logrus.PanicLevel
17-
testLog.Out = ioutil.Discard
17+
testLog.Out = io.Discard
1818
}

runnable.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"encoding/json"
66
"fmt"
77
"html"
8-
"io/ioutil"
98
"os"
109
"os/exec"
1110
"path/filepath"
@@ -187,7 +186,7 @@ func (rn *Runnable) Extract(i int, dir string) *runResult {
187186
"filename": outFileName,
188187
}).Info("extracting example")
189188

190-
err := ioutil.WriteFile(outFileName, []byte(rn.String()), os.FileMode(0600))
189+
err := os.WriteFile(outFileName, []byte(rn.String()), os.FileMode(0600))
191190
if err != nil {
192191
return &runResult{Runnable: rn, Retcode: -1, Error: err}
193192
}
@@ -217,7 +216,7 @@ func (rn *Runnable) Run(i int) *runResult {
217216
return &runResult{Runnable: rn, Retcode: -1, Error: err}
218217
}
219218

220-
tmpDir, err := ioutil.TempDir(baseTmp, "tmp.*")
219+
tmpDir, err := os.MkdirTemp(baseTmp, "tmp.*")
221220
if err != nil {
222221
return &runResult{Runnable: rn, Retcode: -1, Error: err}
223222
}

runner.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package gfmrun
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"os"
76
"time"
87

@@ -76,7 +75,7 @@ func (r *Runner) Run() []error {
7675
sourcesStart := time.Now()
7776

7877
for i, sourceFile := range r.Sources {
79-
sourceBytes, err := ioutil.ReadFile(sourceFile)
78+
sourceBytes, err := os.ReadFile(sourceFile)
8079
if err != nil {
8180
res = append(res, &runResult{Retcode: -1, Error: err})
8281
continue

0 commit comments

Comments
 (0)