@@ -126,8 +126,6 @@ func (s NoopEventHandler) EventChannel() <-chan Event {
126126// ProviderResolutionDetail is a structure which contains a subset of the fields defined in the EvaluationDetail,
127127// representing the result of the provider's flag resolution process
128128// see https://github.com/open-feature/spec/blob/main/specification/types.md#resolution-details
129- // N.B we could use generics but to support older versions of go for now we will have type specific resolution
130- // detail
131129type ProviderResolutionDetail struct {
132130 ResolutionError ResolutionError
133131 Reason Reason
@@ -156,35 +154,24 @@ func (p ProviderResolutionDetail) Error() error {
156154 return errors .New (p .ResolutionError .Error ())
157155}
158156
159- // BoolResolutionDetail provides a resolution detail with boolean type
160- type BoolResolutionDetail struct {
161- Value bool
157+ // GenericResolutionDetail represents the result of the provider's flag resolution process.
158+ type GenericResolutionDetail [ T any ] struct {
159+ Value T
162160 ProviderResolutionDetail
163161}
164162
165- // StringResolutionDetail provides a resolution detail with string type
166- type StringResolutionDetail struct {
167- Value string
168- ProviderResolutionDetail
169- }
170-
171- // FloatResolutionDetail provides a resolution detail with float64 type
172- type FloatResolutionDetail struct {
173- Value float64
174- ProviderResolutionDetail
175- }
176-
177- // IntResolutionDetail provides a resolution detail with int64 type
178- type IntResolutionDetail struct {
179- Value int64
180- ProviderResolutionDetail
181- }
182-
183- // InterfaceResolutionDetail provides a resolution detail with any type
184- type InterfaceResolutionDetail struct {
185- Value any
186- ProviderResolutionDetail
187- }
163+ type (
164+ // BoolResolutionDetail represents the result of the provider's flag resolution process for boolean flags.
165+ BoolResolutionDetail = GenericResolutionDetail [bool ]
166+ // StringResolutionDetail represents the result of the provider's flag resolution process for string flags.
167+ StringResolutionDetail = GenericResolutionDetail [string ]
168+ // FloatResolutionDetail represents the result of the provider's flag resolution process for float64 flags.
169+ FloatResolutionDetail = GenericResolutionDetail [float64 ]
170+ // IntResolutionDetail represents the result of the provider's flag resolution process for int64 flags.
171+ IntResolutionDetail = GenericResolutionDetail [int64 ]
172+ // InterfaceResolutionDetail represents the result of the provider's flag resolution process for Object flags.
173+ InterfaceResolutionDetail = GenericResolutionDetail [any ]
174+ )
188175
189176// Metadata provides provider name
190177type Metadata struct {
0 commit comments