-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint: execute errcheck using ExecInDir
Execute errcheck using ExecInDir so that it will use the package of the current buffer. It looks like it was inadvertently changed from ExecInDir to Exec a long while ago when the exec functions were refactored. Add tests to verify more go#lint#Errcheck behvaviors. Fixes #2725
- Loading branch information
Showing
4 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package errcheck | ||
|
||
import ( | ||
"io" | ||
"os" | ||
) | ||
|
||
func foo() { | ||
io.Copy(os.Stdout, os.Stdin) | ||
} |
11 changes: 11 additions & 0 deletions
11
autoload/go/test-fixtures/lint/src/errcheck/errcheck_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package errcheck | ||
|
||
import ( | ||
"io" | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestFoo(t *testing.T) { | ||
io.Copy(os.Stdout, os.Stdin) | ||
} |