@@ -171,19 +171,13 @@ func NewClient(apiKey string, options ...Option) *Client {
171171 return c
172172}
173173
174- // Returns `Flags` struct holding all the flags for the current environment .
174+ // GetFlags evaluates the feature flags within an EvaluationContext .
175175//
176- // Provide `EvaluationContext` to evaluate flags for a specific environment or identity.
176+ // When flag evaluation fails, the value of each Flag is determined by the default flag handler
177+ // from WithDefaultHandler, if one was provided.
177178//
178- // If local evaluation is enabled this function will not call the Flagsmith API
179- // directly, but instead read the asynchronously updated local environment or
180- // use the default flag handler in case it has not yet been updated.
181- //
182- // Notes:
183- //
184- // * `EvaluationContext.Environment` is ignored in local evaluation mode.
185- //
186- // * `EvaluationContext.Feature` is not yet supported.
179+ // Flags are evaluated remotely by the Flagsmith API by default.
180+ // To evaluate flags locally, instantiate a client using WithLocalEvaluation.
187181func (c * Client ) GetFlags (ctx context.Context , ec * EvaluationContext ) (f Flags , err error ) {
188182 if ec != nil {
189183 ctx = WithEvaluationContext (ctx , * ec )
@@ -194,13 +188,8 @@ func (c *Client) GetFlags(ctx context.Context, ec *EvaluationContext) (f Flags,
194188 return c .GetEnvironmentFlags (ctx )
195189}
196190
197- // Returns `Flags` struct holding all the flags for the current environment.
198- //
199- // If local evaluation is enabled this function will not call the Flagsmith API
200- // directly, but instead read the asynchronously updated local environment or
201- // use the default flag handler in case it has not yet been updated.
202- //
203- // Deprecated: Use `GetFlags` instead.
191+ // GetEnvironmentFlags calls GetFlags using the current environment as the EvaluationContext.
192+ // Equivalent to GetFlags(ctx, nil).
204193func (c * Client ) GetEnvironmentFlags (ctx context.Context ) (f Flags , err error ) {
205194 if c .config .localEvaluation || c .config .offlineMode {
206195 if f , err = c .getEnvironmentFlagsFromEnvironment (); err == nil {
@@ -219,18 +208,7 @@ func (c *Client) GetEnvironmentFlags(ctx context.Context) (f Flags, err error) {
219208 return Flags {}, & FlagsmithClientError {msg : fmt .Sprintf ("Failed to fetch flags with error: %s" , err )}
220209}
221210
222- // Returns `Flags` struct holding all the flags for the current environment for
223- // a given identity.
224- //
225- // If local evaluation is disabled it will also upsert all traits to the
226- // Flagsmith API for future evaluations. Providing a trait with a value of nil
227- // will remove the trait from the identity if it exists.
228- //
229- // If local evaluation is enabled this function will not call the Flagsmith API
230- // directly, but instead read the asynchronously updated local environment or
231- // use the default flag handler in case it has not yet been updated.
232- //
233- // Deprecated: Use `GetFlags` providing `EvaluationContext.Identity` instead.
211+ // GetIdentityFlags calls GetFlags using this identifier and traits as the EvaluationContext.
234212func (c * Client ) GetIdentityFlags (ctx context.Context , identifier string , traits []* Trait ) (f Flags , err error ) {
235213 if c .config .localEvaluation || c .config .offlineMode {
236214 if f , err = c .getIdentityFlagsFromEnvironment (identifier , traits ); err == nil {
0 commit comments