Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
krzko committed Jul 26, 2022
1 parent 2e83efb commit 6c23376
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func initLogger(c *cli.Context) error {
logger, err = cfg.Build()

defer logger.Sync()
if err != nil {
panic(err)
}

return err
}
Expand Down
1 change: 0 additions & 1 deletion internal/cli/metrics_counter_with_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ var generateMetricsCounterWithLabelsCommand = &cli.Command{

func generateMetricsCounterWithLabelsAction(c *cli.Context) error {
var err error
defer logger.Sync()

if c.String("otel-exporter-otlp-endpoint") == "" {
return errors.New("'otel-exporter-otlp-endpoint' must be set")
Expand Down
1 change: 0 additions & 1 deletion internal/cli/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func genTracesCommand() *cli.Command {
},
Action: func(c *cli.Context) error {
var err error
defer logger.Sync()

if c.String("otel-exporter-otlp-endpoint") == "" {
return errors.New("'otel-exporter-otlp-endpoint' must be set")
Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (v *HeaderValue) Set(s string) error {
func Run(ctx context.Context, exp *otlpmetric.Exporter, m metric.Meter, c *Config, logger *zap.Logger) (func(), error) {
limit := rate.Limit(c.Rate)
if c.Rate == 0 {
limit = rate.Inf
limit = rate.Inf //nolint
logger.Info("generation of metrics isn't being throttled")
} else {
logger.Info("generation of metrics is limited", zap.Float64("per-second", float64(limit)))
Expand Down

0 comments on commit 6c23376

Please sign in to comment.