Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Loss of flexibility when using generated flag accessors

Aperta
#163 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
go
Ambito
cli, tooling

Direzione di ricerca

Inizia da internal/generators/golang/golang.tmpl e verifica come gli accessor dei flag generati ottengono e utilizzano attualmente il client. Chiarisci quale proposta debba essere implementata —nomi dei flag esportati, domini configurabili, client generati o un'altra API— e definisci come gli utenti manterranno le azioni a livello di provider, contesto di valutazione e client. L'attività è completata quando il design selezionato è implementato nell'output Go generato e il suo comportamento è verificato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When using generated flag accessors, at least in Go, the user no longer has access to the client. This has several implications:

  1. There is no way for the user to evaluate a flag using a client bound to a provider other than the default provider. Of course this can still be done by creating a new client and performing the evaluations without using the generated code, but that defeats the purpose of generating the code.
  2. A user cannot perform the usual actions on the client, such as setting an evaluation context or calling client.Track.

https://github.com/open-feature/cli/blob/main/internal/generators/golang/golang.tmpl

Suggestions:

  1. Export the names of the generated flags as constants so that users can access the flag names if they need to.
  2. Maybe adjust the schema by adding an optional domain field to each flag that specifies which domain to use to evaluate that flag.
  3. An alternative to point 2: maybe even go as far as to have users (in the flag manifest file) specify an optional array of domains for which they want to generate flags/clients. Then generate flag accessors and a client for every domain that was listed in the flag manifest file.
  4. Export the generated client(s) so that users can access them if needed in order to, for example, add hooks at the client level.
Lingua principale
Go
Stelle
63
Fork
22
Merge medio
1h 10m
PR unite (30g)
24

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-feature/cli

Tutte le issue di open-feature/cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.