Skip to content

Commit 49cc40c

Browse files
authored
lint: require name on interface parameters (#3614)
1 parent 723692c commit 49cc40c

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ linters:
3030
- exhaustive # check exhaustiveness of enum switch statements
3131
- godot # Check if comments end in a period
3232
- gosec # (gas): Inspects source code for security problems
33-
- inamedparam # reports interfaces with unnamed method parameters
3433
- musttag # enforce field tags in (un)marshaled structs
3534
- promlinter # Check Prometheus metrics naming via promlint
3635
- protogetter # Reports direct reads from proto message fields when getters should be used

pkg/acquisition/acquisition.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ func (e *DataSourceUnavailableError) Unwrap() error {
4444
type DataSource interface {
4545
GetMetrics() []prometheus.Collector // Returns pointers to metrics that are managed by the module
4646
GetAggregMetrics() []prometheus.Collector // Returns pointers to metrics that are managed by the module (aggregated mode, limits cardinality)
47-
UnmarshalConfig([]byte) error // Decode and pre-validate the YAML datasource - anything that can be checked before runtime
48-
Configure([]byte, *log.Entry, int) error // Complete the YAML datasource configuration and perform runtime checks.
49-
ConfigureByDSN(string, map[string]string, *log.Entry, string) error // Configure the datasource
47+
UnmarshalConfig(yamlConfig []byte) error // Decode and pre-validate the YAML datasource - anything that can be checked before runtime
48+
Configure(yamlConfig []byte, logger *log.Entry, metricsLevel int) error // Complete the YAML datasource configuration and perform runtime checks.
49+
ConfigureByDSN(dsn string, labels map[string]string, logger *log.Entry, uniqueID string) error // Configure the datasource
5050
GetMode() string // Get the mode (TAIL, CAT or SERVER)
5151
GetName() string // Get the name of the module
52-
OneShotAcquisition(context.Context, chan types.Event, *tomb.Tomb) error // Start one shot acquisition(eg, cat a file)
53-
StreamingAcquisition(context.Context, chan types.Event, *tomb.Tomb) error // Start live acquisition (eg, tail a file)
52+
OneShotAcquisition(ctx context.Context, out chan types.Event, acquisTomb *tomb.Tomb) error // Start one shot acquisition(eg, cat a file)
53+
StreamingAcquisition(ctx context.Context, out chan types.Event, acquisTomb *tomb.Tomb) error // Start live acquisition (eg, tail a file)
5454
CanRun() error // Whether the datasource can run or not (eg, journalctl on BSD is a non-sense)
5555
GetUuid() string // Get the unique identifier of the datasource
5656
Dump() interface{}

pkg/acquisition/modules/appsec/bodyprocessors/raw.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
type rawBodyProcessor struct{}
1313

1414
type setterInterface interface {
15-
Set(string)
15+
Set(value string)
1616
}
1717

1818
func (*rawBodyProcessor) ProcessRequest(reader io.Reader, v plugintypes.TransactionVariables, options plugintypes.BodyProcessorOptions) error {

pkg/hubops/plan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type Command interface {
2929
// an error if the preparation failed.
3030
// NOTE: Returning an error will bubble up from the plan.AddCommand() method,
3131
// but Prepare() might already have modified the plan's command slice.
32-
Prepare(*ActionPlan) (bool, error)
32+
Prepare(plan *ActionPlan) (bool, error)
3333

3434
// Run executes the command within the provided context and ActionPlan.
3535
// It performs the actual operation and returns an error if execution fails.

0 commit comments

Comments
 (0)