Feature flags, also known as feature toggles, are a software development technique that allows developers to turn features on and off in a production environment without requiring a new deployment.
There are several ways to enable/disable features in Golang:
1. Feature Toggles: It provides a simple way to enable/disable features based on environment variables and/or command line arguments
The `toggle` package exists in pkg/toggle can be used to define and manage a feature toggle for a new feature in Kyverno. Let's say we need to introduce a new feature toggle to enable/disable deferred loading. We can do it as follows:
At this point, we have an instance of `toggle` which will be used later to call `toggle.enabled()` of the feature toggle to execute code conditionally.
3. Add a new method `EnableDeferredLoading() bool` in `Toggles` Interface at pkg/toggle/context.go to call the `enabled` method. It will be used later in Kyverno controllers: