Skip to content

Commit

Permalink
fix lint complaints about case-fold builder (#348)
Browse files Browse the repository at this point in the history
* fix lint complaints about case-fold builder

Signed-off-by: Tim Bray <[email protected]>

* missed some linting targets

Signed-off-by: Tim Bray <[email protected]>

* still more, need to update my local linter copy

Signed-off-by: Tim Bray <[email protected]>

---------

Signed-off-by: Tim Bray <[email protected]>
  • Loading branch information
timbray authored Aug 18, 2024
1 parent 79efb7d commit be1752d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
20 changes: 12 additions & 8 deletions code_gen/build_casefolding_table.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core_matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func TestExistsFalseOrder(t *testing.T) {
for _, match := range matches {
msg += fmt.Sprintf(" %s\n", match)
}
t.Errorf(msg)
t.Error(msg)
}
}

Expand Down
6 changes: 3 additions & 3 deletions generic_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,23 @@ func TestRulerNestedArrays(t *testing.T) {

r2, err := q.MatchesForEvent(event2)
if err != nil {
t.Errorf("Matches " + err.Error())
t.Error("Matches " + err.Error())
}
if len(r2) != 0 {
t.Errorf("r2 matchd %d", len(r2))
}

r3, err := q.MatchesForEvent(event3)
if err != nil {
t.Errorf("Matches " + err.Error())
t.Error("Matches " + err.Error())
}
if len(r3) != 0 {
t.Errorf("r3 matchd %d", len(r2))
}

r4, err := q.MatchesForEvent(event4)
if err != nil {
t.Errorf("Matches " + err.Error())
t.Error("Matches " + err.Error())
}
if len(r4) != 1 || r4[0] != "rule3" {
var msg string
Expand Down
4 changes: 2 additions & 2 deletions pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ type tooMuchFiltering struct {
MinAction int64
}

func newTooMuchFiltering(ratio float64, min int64) *tooMuchFiltering {
func newTooMuchFiltering(ratio float64, minimum int64) *tooMuchFiltering {
return &tooMuchFiltering{
FilteredToEmitted: ratio,
MinAction: min,
MinAction: minimum,
}
}

Expand Down
2 changes: 1 addition & 1 deletion quamina_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func TestCityLots(t *testing.T) {
that is slower than the one the software was developed on, in which case you might want to readjust the
"thresholdPerformance" constant. However, it may be that you made a change that reduced the throughput of the
library, which would be unacceptable.`
t.Errorf(message1 + message2)
t.Error(message1 + message2)
}

if len(results) != len(wanted) {
Expand Down
4 changes: 2 additions & 2 deletions rebuilding.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type liveRatioTrigger struct {
MinLive int
}

func newLiveRatioTrigger(ratio float64, min int) *liveRatioTrigger {
func newLiveRatioTrigger(ratio float64, minimum int) *liveRatioTrigger {
return &liveRatioTrigger{
Ratio: ratio,
MinLive: min,
MinLive: minimum,
}
}

Expand Down

1 comment on commit be1752d

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Go Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: be1752d Previous: 78e2ec8 Ratio
BenchmarkCityLots 6877 ns/op 834 B/op 34 allocs/op 5592 ns/op 773 B/op 31 allocs/op 1.23
BenchmarkCityLots - ns/op 6877 ns/op 5592 ns/op 1.23
Benchmark_JsonFlattner_Evaluate_ContextFields 1220 ns/op 96 B/op 8 allocs/op 726.2 ns/op 56 B/op 4 allocs/op 1.68
Benchmark_JsonFlattner_Evaluate_ContextFields - ns/op 1220 ns/op 726.2 ns/op 1.68
Benchmark_JsonFlattner_Evaluate_ContextFields - B/op 96 B/op 56 B/op 1.71
Benchmark_JsonFlattner_Evaluate_ContextFields - allocs/op 8 allocs/op 4 allocs/op 2

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.