RequireExperimentWithDevBypass checks if ALL the given experiments are enabled, but bypasses the check in development mode (buildinfo.IsDev()).
(experiments codersdk.Experiments, requiredExperiments ...codersdk.Experiment)
| 48 | // RequireExperimentWithDevBypass checks if ALL the given experiments are enabled, |
| 49 | // but bypasses the check in development mode (buildinfo.IsDev()). |
| 50 | func RequireExperimentWithDevBypass(experiments codersdk.Experiments, requiredExperiments ...codersdk.Experiment) func(next http.Handler) http.Handler { |
| 51 | return func(next http.Handler) http.Handler { |
| 52 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 53 | if buildinfo.IsDev() { |
| 54 | next.ServeHTTP(w, r) |
| 55 | return |
| 56 | } |
| 57 | |
| 58 | RequireExperiment(experiments, requiredExperiments...)(next).ServeHTTP(w, r) |
| 59 | }) |
| 60 | } |
| 61 | } |
nothing calls this directly
no test coverage detected