func (f Feature) GetVariant(ctx *context.Context) *Variant {
	if f.Enabled && len(f.Variants) > 0 {
		v := f.getOverrideVariant(ctx)
		var variant *Variant
		if v == nil {
			variant = f.getVariantFromWeights(ctx)
		} else {
			variant = &v.Variant
		}
		variant.Enabled = true
		return variant
	}
	return DISABLED_VARIANT
}
Get variant for a given feature which is considered as enabled
package api
import (
	"fmt"
	"math/rand"
	"strconv"
	"time"
	"github.com/Unleash/unleash-client-go/v3/context"
	"github.com/twmb/murmur3"
)
type ParameterMap map[string]interface{}
type FeatureResponse struct {
	Response
	Features []Feature `json:"features"`
}
type Feature struct {
	Name string `json:"name"`
	Description string `json:"description"`
	Enabled bool `json:"enabled"`
	Strategies []Strategy `json:"strategies"`
	CreatedAt time.Time `json:"createdAt"`
	Strategy string `json:"strategy"`
	Parameters ParameterMap `json:"parameters"`
	Variants []VariantInternal `json:"variants"`
}
func (fr FeatureResponse) FeatureMap() map[string]interface{} {
	features := map[string]interface{}{}
	for _, f := range fr.Features {
		features[f.Name] = f
	}
	return features
}