diff --git a/flagd/cmd/start.go b/flagd/cmd/start.go index d88cd8679..eaa1d8f0d 100644 --- a/flagd/cmd/start.go +++ b/flagd/cmd/start.go @@ -39,7 +39,6 @@ const ( func init() { flags := startCmd.Flags() - // allows environment variables to use _ instead of - viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) // sync-provider-args becomes SYNC_PROVIDER_ARGS viper.SetEnvPrefix("FLAGD") // port becomes FLAGD_PORT @@ -167,7 +166,6 @@ var startCmd = &cobra.Command{ SyncProviders: syncProviders, ContextValues: contextValuesToMap, }) - if err != nil { rtLogger.Fatal(err.Error()) } diff --git a/flagd/pkg/runtime/from_config.go b/flagd/pkg/runtime/from_config.go index 67d405074..8bdc6a039 100644 --- a/flagd/pkg/runtime/from_config.go +++ b/flagd/pkg/runtime/from_config.go @@ -106,7 +106,6 @@ func FromConfig(logger *logger.Logger, version string, config Config) (*Runtime, }, config.ContextValues, ) - if err != nil { return nil, fmt.Errorf("error creating ofrep service") } diff --git a/flagd/pkg/service/flag-evaluation/flag_evaluator.go b/flagd/pkg/service/flag-evaluation/flag_evaluator.go index 1d38fe666..911ac10f7 100644 --- a/flagd/pkg/service/flag-evaluation/flag_evaluator.go +++ b/flagd/pkg/service/flag-evaluation/flag_evaluator.go @@ -36,8 +36,12 @@ type OldFlagEvaluationService struct { } // NewOldFlagEvaluationService creates a OldFlagEvaluationService with provided parameters -func NewOldFlagEvaluationService(log *logger.Logger, - eval evaluator.IEvaluator, eventingCfg IEvents, metricsRecorder telemetry.IMetricsRecorder, contextValues map[string]any, +func NewOldFlagEvaluationService( + log *logger.Logger, + eval evaluator.IEvaluator, + eventingCfg IEvents, + metricsRecorder telemetry.IMetricsRecorder, + contextValues map[string]any, ) *OldFlagEvaluationService { svc := &OldFlagEvaluationService{ logger: log, diff --git a/flagd/pkg/service/flag-evaluation/ofrep/handler.go b/flagd/pkg/service/flag-evaluation/ofrep/handler.go index 7990b3052..10217817c 100644 --- a/flagd/pkg/service/flag-evaluation/ofrep/handler.go +++ b/flagd/pkg/service/flag-evaluation/ofrep/handler.go @@ -119,7 +119,9 @@ func extractOfrepRequest(req *http.Request) (ofrep.Request, error) { return request, nil } -func flagdContext(log *logger.Logger, requestID string, request ofrep.Request, contextValues map[string]any) map[string]any { +func flagdContext( + log *logger.Logger, requestID string, request ofrep.Request, contextValues map[string]any, +) map[string]any { context := map[string]any{} if res, ok := request.Context.(map[string]any); ok { context = res diff --git a/flagd/pkg/service/flag-evaluation/ofrep/ofrep_service.go b/flagd/pkg/service/flag-evaluation/ofrep/ofrep_service.go index f8b6883e3..68169307c 100644 --- a/flagd/pkg/service/flag-evaluation/ofrep/ofrep_service.go +++ b/flagd/pkg/service/flag-evaluation/ofrep/ofrep_service.go @@ -29,7 +29,9 @@ type Service struct { server *http.Server } -func NewOfrepService(evaluator evaluator.IEvaluator, origins []string, cfg SvcConfiguration, contextValues map[string]any) (*Service, error) { +func NewOfrepService( + evaluator evaluator.IEvaluator, origins []string, cfg SvcConfiguration, contextValues map[string]any, +) (*Service, error) { corsMW := cors.New(cors.Options{ AllowedOrigins: origins, AllowedMethods: []string{http.MethodPost},