Skip to content

Commit e8304a0

Browse files
Merge pull request #22 from speakeasy-api/dependabot/go_modules/github.com/labstack/echo/v4-4.9.0
chore(deps): bump github.com/labstack/echo/v4 from 4.7.2 to 4.9.0
2 parents 49a1468 + ccdadc6 commit e8304a0

File tree

8 files changed

+79
-81
lines changed

8 files changed

+79
-81
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/setup-go@v3
1616
with:
17-
go-version: 1.14
17+
go-version: 1.16
1818

1919
- name: Configure git for private modules
2020
env:

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x]
17+
go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x]
1818

1919
name: Tests - Go ${{ matrix.go-version }}
2020

.golangci.yaml

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
11
linters:
2-
enable-all: true
3-
disable:
4-
- lll
5-
- varnamelen
6-
- exhaustivestruct
7-
- exhaustruct
8-
- godox
9-
- nlreturn
10-
- wsl
11-
- wrapcheck
12-
- gochecknoglobals
13-
- paralleltest
14-
- dupl
15-
- golint
16-
- maligned
17-
# deprecated/archived
18-
- interfacer
19-
- scopelint
20-
issues:
21-
include:
22-
- EXC0002
23-
- EXC0011
24-
- EXC0012
25-
- EXC0013
26-
- EXC0014
27-
- EXC0015
28-
exclude:
29-
- "returns unexported type"
30-
- "unlambda"
31-
exclude-rules:
32-
# Exclude some linters from running on tests files.
33-
- path: _test\.go
34-
linters:
35-
- goerr113
36-
- funlen
37-
- godot
2+
enable-all: true
3+
disable:
4+
- lll
5+
- varnamelen
6+
- exhaustivestruct
7+
- exhaustruct
8+
- godox
9+
- nlreturn
10+
- wsl
11+
- wrapcheck
12+
- gochecknoglobals
13+
- paralleltest
3814
- dupl
39-
- gocognit
40-
- cyclop
41-
- noctx
42-
- nosnakecase
43-
- maintidx
44-
- gosec
45-
- gocyclo
46-
- path: _exports_test\.go
47-
linters:
48-
- testpackage
49-
- path: cmd/*
50-
linters:
51-
- funlen
15+
- golint
16+
- maligned
17+
# deprecated/archived
18+
- interfacer
19+
- scopelint
20+
issues:
21+
include:
22+
- EXC0002
23+
- EXC0011
24+
- EXC0012
25+
- EXC0013
26+
- EXC0014
27+
- EXC0015
28+
exclude:
29+
- "returns unexported type"
30+
- "unlambda"
31+
exclude-rules:
32+
# Exclude some linters from running on tests files.
33+
- path: _test\.go
34+
linters:
35+
- goerr113
36+
- funlen
37+
- godot
38+
- dupl
39+
- gocognit
40+
- cyclop
41+
- noctx
42+
- nosnakecase
43+
- maintidx
44+
- gosec
45+
- gocyclo
46+
- path: _exports_test\.go
47+
linters:
48+
- testpackage
49+
- path: cmd/*
50+
linters:
51+
- funlen
5252
linters-settings:
53-
tagliatelle:
54-
case:
55-
use-field-name: true
56-
rules:
57-
json: snake
58-
yaml: camel
59-
revive:
60-
rules:
61-
- name: var-naming
62-
arguments: [["API"], []]
63-
stylecheck:
64-
checks: ["all", "-ST1000", "-ST1003"]
65-
cyclop:
66-
max-complexity: 15
53+
tagliatelle:
54+
case:
55+
use-field-name: true
56+
rules:
57+
json: snake
58+
yaml: camel
59+
revive:
60+
rules:
61+
- name: var-naming
62+
arguments: [["API"], []]
63+
stylecheck:
64+
checks: ["all", "-ST1000", "-ST1003"]
65+
cyclop:
66+
max-complexity: 15
6767
run:
68-
go: "1.14"
68+
go: "1.16"

capture.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"io"
7-
"io/ioutil"
87
"net/http"
98
"os"
109
"time"
@@ -48,7 +47,7 @@ func (s *Speakeasy) handleRequestResponseError(w http.ResponseWriter, r *http.Re
4847
// (as io.Reader is a stream and can only be read once) but we are potentially storing a large request (such as a file upload)
4948
// in memory, so we may need to allow the middleware to be configured to not read the body or have a max size
5049
tee := io.TeeReader(r.Body, cw.GetRequestWriter())
51-
r.Body = ioutil.NopCloser(tee)
50+
r.Body = io.NopCloser(tee)
5251
}
5352

5453
ctx, c := contextWithController(r.Context(), s)
@@ -81,7 +80,7 @@ func (s *Speakeasy) captureRequestResponse(cw *captureWriter, r *http.Request, s
8180
if cw.IsReqValid() && cw.GetReqBuffer().Len() == 0 && r.Body != nil {
8281
// Read the body just in case it was not read in the handler
8382
//nolint: errcheck
84-
io.Copy(ioutil.Discard, r.Body)
83+
io.Copy(io.Discard, r.Body)
8584
}
8685

8786
harData, err := json.Marshal(s.harBuilder.buildHarFile(ctx, cw, r, startTime, c))

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/speakeasy-api/speakeasy-go-sdk
22

3-
go 1.14
3+
go 1.16
44

55
require (
66
github.com/chromedp/cdproto v0.0.0-20220629234738-4cfc9cdeeb92
@@ -13,7 +13,7 @@ require (
1313
github.com/go-chi/chi/v5 v5.0.7
1414
github.com/gorilla/handlers v1.5.1
1515
github.com/gorilla/mux v1.8.0
16-
github.com/labstack/echo/v4 v4.7.2
16+
github.com/labstack/echo/v4 v4.9.0
1717
github.com/speakeasy-api/speakeasy-schemas v1.3.0
1818
go.uber.org/zap v1.21.0
1919
google.golang.org/grpc v1.48.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
9191
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
9292
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
9393
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
94-
github.com/labstack/echo/v4 v4.7.2 h1:Kv2/p8OaQ+M6Ex4eGimg9b9e6icoxA42JSlOR3msKtI=
95-
github.com/labstack/echo/v4 v4.7.2/go.mod h1:xkCDAdFCIf8jsFQ5NnbK7oqaF/yU1A1X20Ltm0OvSks=
94+
github.com/labstack/echo/v4 v4.9.0 h1:wPOF1CE6gvt/kmbMR4dGzWvHMPT+sAEUJOwOTtvITVY=
95+
github.com/labstack/echo/v4 v4.9.0/go.mod h1:xkCDAdFCIf8jsFQ5NnbK7oqaF/yU1A1X20Ltm0OvSks=
9696
github.com/labstack/gommon v0.3.1 h1:OomWaJXm7xR6L1HmEtGyQf26TEn7V6X88mktX9kee9o=
9797
github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
9898
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=

harbuilder.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ func (h *harBuilder) getHarResponse(ctx context.Context, cw *captureWriter, r *h
209209
contentLength := cw.origResW.Header().Get("Content-Length")
210210
if contentLength != "" {
211211
var err error
212-
//nolint:gomnd
213212
bodySize, err = strconv.ParseInt(contentLength, 10, 64)
214213
if err != nil {
215214
bodySize = -1

middleware_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"context"
66
"crypto/tls"
77
"encoding/json"
8-
"io/ioutil"
8+
"io"
99
"log"
1010
"math/rand"
1111
"net"
@@ -83,22 +83,22 @@ const (
8383
func loadTestData(t *testing.T) []test {
8484
t.Helper()
8585

86-
files, err := ioutil.ReadDir("testdata")
86+
files, err := os.ReadDir("testdata")
8787
require.NoError(t, err)
8888

8989
tests := []test{}
9090
for _, file := range files {
9191
if strings.HasSuffix(file.Name(), "_input.json") {
9292
baseName := strings.TrimSuffix(file.Name(), "_input.json")
9393

94-
inputData, err := ioutil.ReadFile("testdata/" + file.Name())
94+
inputData, err := os.ReadFile("testdata/" + file.Name())
9595
require.NoError(t, err)
9696

9797
tt := test{}
9898
err = json.Unmarshal(inputData, &tt)
9999
require.NoError(t, err)
100100

101-
outputData, err := ioutil.ReadFile("testdata/" + baseName + "_output.json")
101+
outputData, err := os.ReadFile("testdata/" + baseName + "_output.json")
102102
require.NoError(t, err)
103103

104104
outputDataMinified := bytes.NewBuffer([]byte{})
@@ -221,7 +221,7 @@ func TestSpeakeasy_Middleware_Capture_Success(t *testing.T) {
221221
}
222222

223223
if req.Body != nil {
224-
data, err := ioutil.ReadAll(req.Body)
224+
data, err := io.ReadAll(req.Body)
225225
assert.NoError(t, err)
226226
assert.Equal(t, tt.Args.Body, string(data))
227227
}
@@ -719,7 +719,7 @@ func TestSpeakeasy_GinMiddleware_Success(t *testing.T) {
719719
}
720720

721721
if ctx.Request.Body != nil {
722-
data, err := ioutil.ReadAll(ctx.Request.Body)
722+
data, err := io.ReadAll(ctx.Request.Body)
723723
assert.NoError(t, err)
724724
assert.Equal(t, tt.Args.Body, string(data))
725725
}
@@ -959,7 +959,7 @@ func TestSpeakeasy_EchoMiddleware_Success(t *testing.T) {
959959
}
960960

961961
if c.Request().Body != nil {
962-
data, err := ioutil.ReadAll(c.Request().Body)
962+
data, err := io.ReadAll(c.Request().Body)
963963
assert.NoError(t, err)
964964
assert.Equal(t, tt.Args.Body, string(data))
965965
}

0 commit comments

Comments
 (0)