aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-07-10 17:44:14 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-07-10 18:16:58 +0200
commitd4c58caef7e5fbae992399cb3b28681694468b39 (patch)
tree07e6fb43abc9f0c186333fedff90360e62df6872 /tools
parent56d01184e3b69688dec04bd97a3017df9462f4fc (diff)
tools/syz-linter: enable some standard linters
Enable some x/tools linters that are not enabled in vet. Update #1876
Diffstat (limited to 'tools')
-rw-r--r--tools/syz-linter/linter.go11
-rw-r--r--tools/syz-reporter/reporter.go4
2 files changed, 11 insertions, 4 deletions
diff --git a/tools/syz-linter/linter.go b/tools/syz-linter/linter.go
index a19bfa3f4..d69ca0a2a 100644
--- a/tools/syz-linter/linter.go
+++ b/tools/syz-linter/linter.go
@@ -25,6 +25,11 @@ import (
"unicode"
"golang.org/x/tools/go/analysis"
+ "golang.org/x/tools/go/analysis/passes/atomicalign"
+ "golang.org/x/tools/go/analysis/passes/copylock"
+ "golang.org/x/tools/go/analysis/passes/deepequalerrors"
+ "golang.org/x/tools/go/analysis/passes/nilness"
+ "golang.org/x/tools/go/analysis/passes/structtag"
)
var AnalyzerPlugin analyzerPlugin
@@ -38,6 +43,12 @@ func main() {
func (*analyzerPlugin) GetAnalyzers() []*analysis.Analyzer {
return []*analysis.Analyzer{
SyzAnalyzer,
+ // Some standard analyzers that are not enabled in vet.
+ atomicalign.Analyzer,
+ copylock.Analyzer,
+ deepequalerrors.Analyzer,
+ nilness.Analyzer,
+ structtag.Analyzer,
}
}
diff --git a/tools/syz-reporter/reporter.go b/tools/syz-reporter/reporter.go
index 5657d2eb9..948809ea7 100644
--- a/tools/syz-reporter/reporter.go
+++ b/tools/syz-reporter/reporter.go
@@ -131,10 +131,6 @@ func readCrash(workdir, dir string) *UICrashType {
return nil
}
desc := string(trimNewLines(descBytes))
- if err != nil {
- return nil
- }
-
descFile.Close()
files, err := osutil.ListDir(filepath.Join(crashdir, dir))