Skip to content

Commit

Permalink
Enable prealloc checker and fix existing violations
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusbaeck committed Jan 2, 2020
1 parent 79f3ece commit fef0b9d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ linters:
- gosimple
- ineffassign
- misspell
- prealloc
- staticcheck
- structcheck
- typecheck
Expand Down
2 changes: 1 addition & 1 deletion logstash-filter-verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func runTests(inv *logstash.Invocation, tests []testcase.TestCaseSet, diffComman
// the actual events against the expected set. Returns an error if
// at least one test case fails or if there's a problem running the tests.
func runParallelTests(inv *logstash.Invocation, tests []testcase.TestCaseSet, diffCommand []string, keptEnvVars []string) error {
var testStreams []*logstash.TestStream
testStreams := make([]*logstash.TestStream, 0, len(tests))

badCodecs := map[string]string{
"json": "json_lines",
Expand Down
2 changes: 1 addition & 1 deletion testcase/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func discoverTestDirectory(path string) ([]TestCaseSet, error) {
if err != nil {
return nil, fmt.Errorf("Error discovering test case files: %s", err)
}
var result []TestCaseSet
result := make([]TestCaseSet, 0, len(files))
for _, f := range files {
if f.IsDir() || (!strings.HasSuffix(f.Name(), ".json") && !strings.HasSuffix(f.Name(), ".yaml") && !strings.HasSuffix(f.Name(), ".yml")) {
continue
Expand Down

0 comments on commit fef0b9d

Please sign in to comment.