mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 13:44:03 +03:00
Update code to the latest golangci-lint
This commit is contained in:
@@ -115,7 +115,7 @@ func makeIPBlocklist(conf *config.Config, logger mtglib.Logger, ntw mtglib.Netwo
|
||||
}
|
||||
|
||||
func makeEventStream(conf *config.Config, logger mtglib.Logger) (mtglib.EventStream, error) {
|
||||
factories := make([]events.ObserverFactory, 0, 2)
|
||||
factories := make([]events.ObserverFactory, 0, 2) // nolint: gomnd
|
||||
|
||||
if conf.Stats.StatsD.Enabled.Get(false) {
|
||||
statsdFactory, err := stats.NewStatsd(
|
||||
|
||||
@@ -34,7 +34,7 @@ func (s *SimpleRun) Run(cli *CLI, version string) error { // nolint: cyclop
|
||||
return fmt.Errorf("incorrect secret: %w", err)
|
||||
}
|
||||
|
||||
if err := conf.Concurrency.Set(strconv.FormatUint(s.Concurrency, 10)); err != nil {
|
||||
if err := conf.Concurrency.Set(strconv.FormatUint(s.Concurrency, 10)); err != nil { // nolint: gomnd
|
||||
return fmt.Errorf("incorrect concurrency: %w", err)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func (s *SimpleRun) Run(cli *CLI, version string) error { // nolint: cyclop
|
||||
return fmt.Errorf("incorrect prefer-ip: %w", err)
|
||||
}
|
||||
|
||||
if err := conf.DomainFrontingPort.Set(strconv.FormatUint(s.DomainFrontingPort, 10)); err != nil {
|
||||
if err := conf.DomainFrontingPort.Set(strconv.FormatUint(s.DomainFrontingPort, 10)); err != nil { // nolint: gomnd
|
||||
return fmt.Errorf("incorrect domain-fronting-port: %w", err)
|
||||
}
|
||||
|
||||
@@ -72,9 +72,6 @@ func (s *SimpleRun) Run(cli *CLI, version string) error { // nolint: cyclop
|
||||
|
||||
conf.Debug.Value = s.Debug
|
||||
conf.Defense.AntiReplay.Enabled.Value = true
|
||||
conf.Defense.Blocklist.Enabled.Value = false
|
||||
conf.Stats.StatsD.Enabled.Value = false
|
||||
conf.Stats.Prometheus.Enabled.Value = false
|
||||
|
||||
if err := conf.Validate(); err != nil {
|
||||
return fmt.Errorf("invalid result configuration: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user