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

httpapi: suspicious condition in srv_test.go #164

Open
quasilyte opened this issue Dec 10, 2018 · 0 comments
Open

httpapi: suspicious condition in srv_test.go #164

quasilyte opened this issue Dec 10, 2018 · 0 comments

Comments

@quasilyte
Copy link
Contributor

if r == nil && r == fmt.Sprintf("Failed to start HTTPS service - %s", errMessage) {

Looks like there is a mistake inside 3 recovers inside that file.
If r is nil, it can't match sprintf result, so there is something wrong here.
I would guess that && should be changed to ||, but r == fmt.Sprintf(...) also look incorrect.
Anyway, I don't have any context, it looks like it tries to test that panic is caught and that the value returned by recover match the expected one. Code inside tests doesn't do that in a clear way. right now.

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

No branches or pull requests

1 participant