IsFeatureEnabled checks the feature flag (GET /features) for a given feature. Returns true when the feature is rolled out.
(ctx context.Context, feature string)
| 168 | // IsFeatureEnabled checks the feature flag (GET /features) for a given |
| 169 | // feature. Returns true when the feature is rolled out. |
| 170 | func (c *Client) IsFeatureEnabled(ctx context.Context, feature string) (bool, error) { |
| 171 | flags, err := c.FeatureFlags(ctx) |
| 172 | if err != nil { |
| 173 | return false, err |
| 174 | } |
| 175 | return flags[feature].Enabled, nil |
| 176 | } |
| 177 | |
| 178 | // IsFeatureActive reports whether Docker Desktop is the active engine and the |
| 179 | // given feature flag is enabled. Returns false silently on any failure — the |
no test coverage detected