Skip to content

Commit d555702

Browse files
committed
unused parameters/errors
1 parent 0b9ae85 commit d555702

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

cmd/crowdsec/appsec_stub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ import (
66
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
77
)
88

9-
func LoadAppsecRules(hub *cwhub.Hub) error {
9+
func LoadAppsecRules(_ *cwhub.Hub) error {
1010
return nil
1111
}

cmd/crowdsec/crowdsec.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ func startParserRoutines(cConfig *csconfig.Config, parsers *parser.Parsers) {
7979
parsersTomb.Go(func() error {
8080
defer trace.CatchPanic("crowdsec/runParse")
8181

82-
if err := runParse(inputLineChan, inputEventChan, *parsers.Ctx, parsers.Nodes); err != nil {
83-
// this error will never happen as parser.Parse is not able to return errors
84-
return err
85-
}
82+
runParse(inputLineChan, inputEventChan, *parsers.Ctx, parsers.Nodes)
8683

8784
return nil
8885
})
@@ -147,7 +144,6 @@ func startLPMetrics(ctx context.Context, cConfig *csconfig.Config, apiClient *ap
147144
apiClient,
148145
lpMetricsDefaultInterval,
149146
log.WithField("service", "lpmetrics"),
150-
[]string{},
151147
datasources,
152148
hub,
153149
)

cmd/crowdsec/lpmetrics.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func getHubState(hub *cwhub.Hub) models.HubItems {
8888
}
8989

9090
// newStaticMetrics is called when the process starts, or reloads the configuration
91-
func newStaticMetrics(consoleOptions []string, datasources []acquisition.DataSource, hub *cwhub.Hub) staticMetrics {
91+
func newStaticMetrics(datasources []acquisition.DataSource, hub *cwhub.Hub) staticMetrics {
9292
datasourceMap := map[string]int64{}
9393

9494
for _, ds := range datasources {
@@ -112,11 +112,10 @@ func NewMetricsProvider(
112112
apic *apiclient.ApiClient,
113113
interval time.Duration,
114114
logger *logrus.Entry,
115-
consoleOptions []string,
116115
datasources []acquisition.DataSource,
117116
hub *cwhub.Hub,
118117
) *MetricsProvider {
119-
static := newStaticMetrics(consoleOptions, datasources, hub)
118+
static := newStaticMetrics(datasources, hub)
120119

121120
logger.Debugf("Detected %s %s (family: %s)", static.osName, static.osVersion, static.osFamily)
122121

cmd/crowdsec/parse.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ func parseEvent(
5959
return &parsed
6060
}
6161

62-
func runParse(input chan pipeline.Event, output chan pipeline.Event, parserCTX parser.UnixParserCtx, nodes []parser.Node) error {
62+
func runParse(input chan pipeline.Event, output chan pipeline.Event, parserCTX parser.UnixParserCtx, nodes []parser.Node) {
6363
for {
6464
select {
6565
case <-parsersTomb.Dying():
6666
log.Infof("Killing parser routines")
67-
return nil
67+
return
6868
case event := <-input:
6969
parsed := parseEvent(event, parserCTX, nodes)
7070
if parsed == nil {

cmd/crowdsec/win_service_manage.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
"fmt"
1111
"time"
1212

13-
//"time"
14-
1513
"golang.org/x/sys/windows/svc"
1614
"golang.org/x/sys/windows/svc/mgr"
1715
)

0 commit comments

Comments
 (0)