Skip to content

Commit

Permalink
fix: linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alemrtv committed Nov 23, 2024
1 parent 4145161 commit 7f23729
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 0 additions & 2 deletions flagd/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -167,7 +166,6 @@ var startCmd = &cobra.Command{
SyncProviders: syncProviders,
ContextValues: contextValuesToMap,
})

if err != nil {
rtLogger.Fatal(err.Error())
}
Expand Down
1 change: 0 additions & 1 deletion flagd/pkg/runtime/from_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
8 changes: 6 additions & 2 deletions flagd/pkg/service/flag-evaluation/flag_evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion flagd/pkg/service/flag-evaluation/ofrep/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion flagd/pkg/service/flag-evaluation/ofrep/ofrep_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 7f23729

Please sign in to comment.