Skip to content

Commit ee163d0

Browse files
mod: bump golang.org/x/crypto from 0.36.0 to 0.37.0 (#260)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joe Chen <jc@unknwon.io>
1 parent d5b5e3a commit ee163d0

11 files changed

Lines changed: 50 additions & 40 deletions

File tree

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Checkout code
2525
uses: actions/checkout@v4
2626
- name: Run golangci-lint
27-
uses: golangci/golangci-lint-action@v2
27+
uses: golangci/golangci-lint-action@v7
2828
with:
2929
version: latest
3030
args: --timeout=30m

.golangci.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
1-
linters-settings:
2-
nakedret:
3-
max-func-lines: 0 # Disallow any unnamed return statement
4-
1+
version: "2"
52
linters:
63
enable:
7-
- unused
8-
- errcheck
9-
- gosimple
10-
- govet
11-
- ineffassign
12-
- staticcheck
13-
- typecheck
144
- nakedret
15-
- gofmt
165
- rowserrcheck
176
- unconvert
18-
- goimports
197
- unparam
8+
settings:
9+
nakedret:
10+
max-func-lines: 0 # Disallow any unnamed return statement
11+
exclusions:
12+
generated: lax
13+
presets:
14+
- comments
15+
- common-false-positives
16+
- legacy
17+
- std-error-handling
18+
paths:
19+
- third_party$
20+
- builtin$
21+
- examples$
22+
formatters:
23+
enable:
24+
- gofmt
25+
- goimports
26+
exclusions:
27+
generated: lax
28+
paths:
29+
- third_party$
30+
- builtin$
31+
- examples$

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/go-macaron/inject v0.0.0-20160627170012-d8a0b8677191
77
github.com/smartystreets/goconvey v1.8.1
88
github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e
9-
golang.org/x/crypto v0.36.0
9+
golang.org/x/crypto v0.37.0
1010
gopkg.in/ini.v1 v1.66.6
1111
)
1212

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
2121
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
2222
github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e h1:GSGeB9EAKY2spCABz6xOX5DbxZEXolK+nBSvmsQwRjM=
2323
github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM=
24-
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
25-
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
24+
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
25+
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
2626
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2727
gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI=
2828
gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=

macaron.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func NewWithLogger(out io.Writer) *Macaron {
125125
Router: NewRouter(),
126126
logger: log.New(out, "[Macaron] ", 0),
127127
}
128-
m.Router.m = m
128+
m.m = m
129129
m.Map(m.logger)
130130
m.Map(defaultReturnHandler())
131131
m.NotFound(http.NotFound)

recovery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func function(pc uintptr) []byte {
127127
if period := bytes.Index(name, dot); period >= 0 {
128128
name = name[period+1:]
129129
}
130-
name = bytes.Replace(name, centerDot, dot, -1)
130+
name = bytes.ReplaceAll(name, centerDot, dot)
131131
return name
132132
}
133133

render.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ func compile(opt RenderOptions) *template.Template {
281281
opt.TemplateFileSystem = NewTemplateFileSystem(opt, false)
282282
}
283283

284-
for _, f := range opt.TemplateFileSystem.ListFiles() {
284+
for _, f := range opt.ListFiles() {
285285
tmpl := t.New(f.Name())
286286
for _, funcs := range opt.Funcs {
287287
tmpl.Funcs(funcs)
@@ -533,11 +533,11 @@ func (r *TplRender) addYield(t *template.Template, tplName string, data interfac
533533
}
534534

535535
func (r *TplRender) renderBytes(setName, tplName string, data interface{}, htmlOpt ...HTMLOptions) (*bytes.Buffer, error) {
536-
t := r.TemplateSet.Get(setName)
536+
t := r.Get(setName)
537537
if Env == DEV {
538538
opt := *r.Opt
539-
opt.Directory = r.TemplateSet.GetDir(setName)
540-
t = r.TemplateSet.Set(setName, &opt)
539+
opt.Directory = r.GetDir(setName)
540+
t = r.Set(setName, &opt)
541541
}
542542
if t == nil {
543543
return nil, fmt.Errorf("html/template: template \"%s\" is undefined", tplName)
@@ -634,11 +634,11 @@ func (r *TplRender) SetTemplatePath(setName, dir string) {
634634
}
635635
opt := *r.Opt
636636
opt.Directory = dir
637-
r.TemplateSet.Set(setName, &opt)
637+
r.Set(setName, &opt)
638638
}
639639

640640
func (r *TplRender) HasTemplateSet(name string) bool {
641-
return r.TemplateSet.Get(name) != nil
641+
return r.Get(name) != nil
642642
}
643643

644644
// DummyRender is used when user does not choose any real render to use.

render_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,19 +686,19 @@ func Test_dummyRender(t *testing.T) {
686686
})
687687
m.Get("/htmlsetstring", func(ctx *Context) {
688688
defer shouldPanic()
689-
_, _ = ctx.Render.HTMLSetString("", "", nil)
689+
_, _ = ctx.HTMLSetString("", "", nil)
690690
})
691691
m.Get("/htmlstring", func(ctx *Context) {
692692
defer shouldPanic()
693-
_, _ = ctx.Render.HTMLString("", nil)
693+
_, _ = ctx.HTMLString("", nil)
694694
})
695695
m.Get("/htmlsetbytes", func(ctx *Context) {
696696
defer shouldPanic()
697-
_, _ = ctx.Render.HTMLSetBytes("", "", nil)
697+
_, _ = ctx.HTMLSetBytes("", "", nil)
698698
})
699699
m.Get("/htmlbytes", func(ctx *Context) {
700700
defer shouldPanic()
701-
_, _ = ctx.Render.HTMLBytes("", nil)
701+
_, _ = ctx.HTMLBytes("", nil)
702702
})
703703
m.Get("/xml", func(ctx *Context) {
704704
defer shouldPanic()

router_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func test_Router_Handle(t *testing.T, isFast bool) {
4646

4747
if isFast {
4848
// FastInvoker Handler Wrap Action
49-
m.Router.SetHandlerWrapper(func(h Handler) Handler {
49+
m.SetHandlerWrapper(func(h Handler) Handler {
5050
switch v := h.(type) {
5151
case func() string:
5252
return handlerFunc0Invoker(v)
@@ -138,7 +138,7 @@ func test_Router_Handle(t *testing.T, isFast bool) {
138138

139139
if isFast {
140140
//remove Handler Wrap Action
141-
m.Router.SetHandlerWrapper(nil)
141+
m.SetHandlerWrapper(nil)
142142
}
143143
})
144144

static_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func Test_Static(t *testing.T) {
7777

7878
resp := httptest.NewRecorder()
7979
resp.Body = new(bytes.Buffer)
80-
req, err := http.NewRequest("GET", "http://localhost:4000/"+path.Base(strings.Replace(f.Name(), "\\", "/", -1)), nil)
80+
req, err := http.NewRequest("GET", "http://localhost:4000/"+path.Base(strings.ReplaceAll(f.Name(), "\\", "/")), nil)
8181
So(err, ShouldBeNil)
8282
m.ServeHTTP(resp, req)
8383
So(resp.Code, ShouldEqual, http.StatusOK)

0 commit comments

Comments
 (0)