@@ -235,8 +235,9 @@ func setOtelEndpointCmdFunc(_ *cobra.Command, args []string) error {
235235 }
236236
237237 // Update the configuration
238- err := config .UpdateConfig (func (c * config.Config ) {
238+ err := config .UpdateConfig (func (c * config.Config ) error {
239239 c .OTEL .Endpoint = endpoint
240+ return nil
240241 })
241242 if err != nil {
242243 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -269,8 +270,9 @@ func unsetOtelEndpointCmdFunc(_ *cobra.Command, _ []string) error {
269270 }
270271
271272 // Update the configuration
272- err := config .UpdateConfig (func (c * config.Config ) {
273+ err := config .UpdateConfig (func (c * config.Config ) error {
273274 c .OTEL .Endpoint = ""
275+ return nil
274276 })
275277 if err != nil {
276278 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -292,8 +294,9 @@ func setOtelSamplingRateCmdFunc(_ *cobra.Command, args []string) error {
292294 }
293295
294296 // Update the configuration
295- err = config .UpdateConfig (func (c * config.Config ) {
297+ err = config .UpdateConfig (func (c * config.Config ) error {
296298 c .OTEL .SamplingRate = rate
299+ return nil
297300 })
298301 if err != nil {
299302 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -326,8 +329,9 @@ func unsetOtelSamplingRateCmdFunc(_ *cobra.Command, _ []string) error {
326329 }
327330
328331 // Update the configuration
329- err := config .UpdateConfig (func (c * config.Config ) {
332+ err := config .UpdateConfig (func (c * config.Config ) error {
330333 c .OTEL .SamplingRate = 0.0
334+ return nil
331335 })
332336 if err != nil {
333337 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -346,8 +350,9 @@ func setOtelEnvVarsCmdFunc(_ *cobra.Command, args []string) error {
346350 }
347351
348352 // Update the configuration
349- err := config .UpdateConfig (func (c * config.Config ) {
353+ err := config .UpdateConfig (func (c * config.Config ) error {
350354 c .OTEL .EnvVars = vars
355+ return nil
351356 })
352357 if err != nil {
353358 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -380,8 +385,9 @@ func unsetOtelEnvVarsCmdFunc(_ *cobra.Command, _ []string) error {
380385 }
381386
382387 // Update the configuration
383- err := config .UpdateConfig (func (c * config.Config ) {
388+ err := config .UpdateConfig (func (c * config.Config ) error {
384389 c .OTEL .EnvVars = []string {}
390+ return nil
385391 })
386392 if err != nil {
387393 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -398,8 +404,9 @@ func setOtelMetricsEnabledCmdFunc(_ *cobra.Command, args []string) error {
398404 }
399405
400406 // Update the configuration
401- err = config .UpdateConfig (func (c * config.Config ) {
407+ err = config .UpdateConfig (func (c * config.Config ) error {
402408 c .OTEL .MetricsEnabled = & enabled
409+ return nil
403410 })
404411 if err != nil {
405412 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -428,8 +435,9 @@ func unsetOtelMetricsEnabledCmdFunc(_ *cobra.Command, _ []string) error {
428435 }
429436
430437 // Update the configuration
431- err := config .UpdateConfig (func (c * config.Config ) {
438+ err := config .UpdateConfig (func (c * config.Config ) error {
432439 c .OTEL .MetricsEnabled = nil
440+ return nil
433441 })
434442 if err != nil {
435443 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -446,8 +454,9 @@ func setOtelTracingEnabledCmdFunc(_ *cobra.Command, args []string) error {
446454 }
447455
448456 // Update the configuration
449- err = config .UpdateConfig (func (c * config.Config ) {
457+ err = config .UpdateConfig (func (c * config.Config ) error {
450458 c .OTEL .TracingEnabled = & enabled
459+ return nil
451460 })
452461 if err != nil {
453462 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -476,8 +485,9 @@ func unsetOtelTracingEnabledCmdFunc(_ *cobra.Command, _ []string) error {
476485 }
477486
478487 // Update the configuration
479- err := config .UpdateConfig (func (c * config.Config ) {
488+ err := config .UpdateConfig (func (c * config.Config ) error {
480489 c .OTEL .TracingEnabled = nil
490+ return nil
481491 })
482492 if err != nil {
483493 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -494,8 +504,9 @@ func setOtelInsecureCmdFunc(_ *cobra.Command, args []string) error {
494504 }
495505
496506 // Update the configuration
497- err = config .UpdateConfig (func (c * config.Config ) {
507+ err = config .UpdateConfig (func (c * config.Config ) error {
498508 c .OTEL .Insecure = enabled
509+ return nil
499510 })
500511 if err != nil {
501512 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -523,8 +534,9 @@ func unsetOtelInsecureCmdFunc(_ *cobra.Command, _ []string) error {
523534 }
524535
525536 // Update the configuration
526- err := config .UpdateConfig (func (c * config.Config ) {
537+ err := config .UpdateConfig (func (c * config.Config ) error {
527538 c .OTEL .Insecure = false
539+ return nil
528540 })
529541 if err != nil {
530542 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -541,8 +553,9 @@ func setOtelEnablePrometheusMetricsPathCmdFunc(_ *cobra.Command, args []string)
541553 }
542554
543555 // Update the configuration
544- err = config .UpdateConfig (func (c * config.Config ) {
556+ err = config .UpdateConfig (func (c * config.Config ) error {
545557 c .OTEL .EnablePrometheusMetricsPath = enabled
558+ return nil
546559 })
547560 if err != nil {
548561 return fmt .Errorf ("failed to update configuration: %w" , err )
@@ -570,8 +583,9 @@ func unsetOtelEnablePrometheusMetricsPathCmdFunc(_ *cobra.Command, _ []string) e
570583 }
571584
572585 // Update the configuration
573- err := config .UpdateConfig (func (c * config.Config ) {
586+ err := config .UpdateConfig (func (c * config.Config ) error {
574587 c .OTEL .EnablePrometheusMetricsPath = false
588+ return nil
575589 })
576590 if err != nil {
577591 return fmt .Errorf ("failed to update configuration: %w" , err )
0 commit comments