Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Package experiment provides functionality for experiments.
package experiment

import (
	
)

type contextKey struct{}
Set is the set of experiments that are enabled for a request.
type Set struct {
	set map[string]bool
}
Active returns a list of all the active experiments in s.
func ( *Set) () []string {
	if  == nil {
		return nil
	}
	var  []string
	for  := range .set {
		 = append(, )
	}
	return 
}
FromContent returns the set of experiments enabled for the content.
func ( context.Context) *Set {
	,  := .Value(contextKey{}).(*Set)
	return 
}
NewSet creates a new experiment.Set with the data provided.
func ( ...string) *Set {
	 := map[string]bool{}
	for ,  := range  {
		[] = true
	}
	return &Set{set: }
}
NewContext stores a set constructed from the provided experiment names in the context.
func ( context.Context,  ...string) context.Context {
	return context.WithValue(, contextKey{}, NewSet(...))
}
IsActive reports whether an experiment is active for this set.
func ( context.Context,  string) bool {
	return FromContext().IsActive()
}
IsActive reports whether an experiment is active for this set.
func ( *Set) ( string) bool {
	if  == nil {
		return false
	}
	return .set[]