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

Fix errcheck issues in tests #227

Merged
merged 1 commit into from
Feb 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions errcheck/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ func TestAnalyzer(t *testing.T) {

t.Run("check blanks", func(t *testing.T) {
packageDir := filepath.Join(analysistest.TestData(), "src/blank/")
Analyzer.Flags.Set("blank", "true")
_ = Analyzer.Flags.Set("blank", "true")
_ = analysistest.Run(t, packageDir, Analyzer)
Analyzer.Flags.Set("blank", "false") // reset it
_ = Analyzer.Flags.Set("blank", "false") // reset it
})

t.Run("check asserts", func(t *testing.T) {
packageDir := filepath.Join(analysistest.TestData(), "src/assert/")
Analyzer.Flags.Set("assert", "true")
_ = Analyzer.Flags.Set("assert", "true")
_ = analysistest.Run(t, packageDir, Analyzer)
Analyzer.Flags.Set("assert", "false") // reset it
_ = Analyzer.Flags.Set("assert", "false") // reset it
})
}
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestMain(t *testing.T) {

os.Stderr = saveStderr
os.Stdout = saveStdout
os.Chdir(saveCwd)
_ = os.Chdir(saveCwd)

out := <-bufChannel

Expand Down