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

improve report msg #12

Merged
merged 2 commits into from
Sep 18, 2021
Merged

improve report msg #12

merged 2 commits into from
Sep 18, 2021

Conversation

sivchari
Copy link
Owner

No description provided.

_ = err
}
}

func testTB(tb testing.TB) {
os.Setenv("a", "b") // want "func testTB is not using testing.Setenv"
os.Setenv("a", "b") // want "os.Setenv() can be replaced by `tb.Setenv()` in testTB"
Copy link
Contributor

@ldez ldez Sep 18, 2021

Choose a reason for hiding this comment

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

Suggested change
os.Setenv("a", "b") // want "os.Setenv() can be replaced by `tb.Setenv()` in testTB"
os.Setenv("a", "b") // want "os\\.Setenv\\(\\) can be replaced by `tb\\.Setenv\\(\\)` in testTB"

Comment on lines 31 to 32
os.Setenv("a", "b") // want "os.Setenv() can be replaced by `b.Setenv()` in BenchmarkF"
if err := os.Setenv("a", "b"); err != nil { // want "os.Setenv() can be replaced by `b.Setenv()` in BenchmarkF"
Copy link
Contributor

@ldez ldez Sep 18, 2021

Choose a reason for hiding this comment

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

Suggested change
os.Setenv("a", "b") // want "os.Setenv() can be replaced by `b.Setenv()` in BenchmarkF"
if err := os.Setenv("a", "b"); err != nil { // want "os.Setenv() can be replaced by `b.Setenv()` in BenchmarkF"
os.Setenv("a", "b") // want "os\\.Setenv\\(\\) can be replaced by `b\\.Setenv\\(\\)` in BenchmarkF"
if err := os.Setenv("a", "b"); err != nil { // want "os\\.Setenv\\(\\) can be replaced by `b\\.Setenv\\(\\)` in BenchmarkF"

Comment on lines 23 to 24
os.Setenv("a", "b") // want "os.Setenv() can be replaced by `t.Setenv()` in TestF"
if err := os.Setenv("a", "b"); err != nil { // want "os.Setenv() can be replaced by `t.Setenv()` in TestF"
Copy link
Contributor

@ldez ldez Sep 18, 2021

Choose a reason for hiding this comment

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

Suggested change
os.Setenv("a", "b") // want "os.Setenv() can be replaced by `t.Setenv()` in TestF"
if err := os.Setenv("a", "b"); err != nil { // want "os.Setenv() can be replaced by `t.Setenv()` in TestF"
os.Setenv("a", "b") // want "os\\.Setenv\\(\\) can be replaced by `t\\.Setenv\\(\\)` in TestF"
if err := os.Setenv("a", "b"); err != nil { // want "os\\.Setenv\\(\\) can be replaced by `t\\.Setenv\\(\\)` in TestF"

@ldez
Copy link
Contributor

ldez commented Sep 18, 2021

The want pattern is a regular expression, then (, ), and . are seen as expressions and not characters then you have to escape those characters.

@sivchari
Copy link
Owner Author

Thanks! I've mistook.

@sivchari sivchari merged commit bfe0636 into main Sep 18, 2021
@sivchari sivchari deleted the improve-report branch September 18, 2021 19:06
@sivchari sivchari changed the title wip improve report msg Sep 18, 2021
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

Successfully merging this pull request may close these issues.

2 participants