Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various linter updates #2469

Closed
wants to merge 9 commits into from
Closed

Conversation

leonklingele
Copy link
Member

See the individual commit messages for details.

A data race in fasthttp was identified using the stricter config. See valyala/fasthttp#1565.

helpers.go Outdated Show resolved Hide resolved
ctx_test.go Outdated Show resolved Hide resolved
.golangci.yml Outdated Show resolved Hide resolved
func (app *App) Test(req *http.Request, msTimeout ...int) (*http.Response, error) {
// Set timeout
timeout := 1000
timeout := int((10 * time.Second) / time.Millisecond)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would be a breaking change

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I don't really know how to avoid it though. As most of the tests run concurrently now, individual tests might take longer than the previous 1 second defined here due to the Go scheduler rescheduling execution between tests.

What do you think of adding and using a new app.TestWithDynamicTimeout(req *http.Request, msTimeout ...int) which defaults this to a timeout of 10s as of now, and might be further increased in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ReneWerner87 what do you recommend to do about this?

ctx.go Show resolved Hide resolved
ctx_test.go Outdated Show resolved Hide resolved
docs/api/ctx.md Outdated Show resolved Hide resolved
helpers.go Outdated Show resolved Hide resolved
middleware/monitor/monitor.go Outdated Show resolved Hide resolved
middleware/session/data.go Show resolved Hide resolved
middleware/session/store.go Show resolved Hide resolved
mount_test.go Show resolved Hide resolved
prefork_test.go Show resolved Hide resolved
@ReneWerner87
Copy link
Member

@leonklingele can you answer the other questions from the review

@ReneWerner87
Copy link
Member

leon is not available for 2 weeks, lets wait with this until he is available

@efectn
Copy link
Member

efectn commented Jul 7, 2023

hey @leonklingele any updates on this?

@ReneWerner87
Copy link
Member

@leonklingele ping

@leonklingele
Copy link
Member Author

leonklingele commented Sep 1, 2023 via email

@ReneWerner87
Copy link
Member

Totally forgot about this! Will get to it some time next week.

ok thx

@leonklingele leonklingele force-pushed the lint-updates branch 3 times, most recently from 0026bd0 to daaee0a Compare September 8, 2023 23:14
@leonklingele
Copy link
Member Author

@ReneWerner87 Updated & rebased. PTAL :)

.github/workflows/test.yml Outdated Show resolved Hide resolved
Copy link
Member

@gaby gaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

ctx_test.go Show resolved Hide resolved
QueryParam string `query:"query_param"`
HeaderParam string `reqHeader:"header_param"`
BodyParam string `json:"body_param" xml:"body_param" form:"body_param"`
QueryParam string ` query:"query_param"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems wrong spacing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it's done intentionally so one can better differentiate the various tags being used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the line width will increase. I'd prefer old layout

password := c.Locals("password").(string)
username, ok := c.Locals("username").(string)
if !ok {
t.Fatal("missing username")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to use assertequal

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be part of another MR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be part of another MR.

It can be done in this PR since it was added here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. How would you use assertequal here? We want to retrieve the user + pass from locals.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. How would you use assertequal here? We want to retrieve the user + pass from locals.

utils.AssertEqual(t, true, ok)

@ReneWerner87
Copy link
Member

@leonklingele hi can you look again, last time you were unfortunately not quite finished with the merges and now some places have been added

maybe we can also split the parts into individual pull requests so that we can merge them in a timely manner

think some customizations from you from these pull requests would be very good for our code

@ReneWerner87
Copy link
Member

Closed due to conflicts and because v2 will not receive any further customizations
You are welcome to customize v3 so that these changes are implemented there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants