Copyright 2020 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.
Command create_experiment_config creates an experiment.yaml file, which will set a rollout of 100 for all experiments.
package main

import (
	
	
	
	
	

	
	
)

type Experiment struct {
	Name    string `yaml:"name"`
	Rollout int    `yaml:"rollout"`
}

func () {
	,  := experimentsYAML()
	if  != nil {
		log.Fatal()
	}
	if  := writeConfigFile();  != nil {
		log.Fatal()
	}
}

func () ([]byte, error) {
	var  []*Experiment
	for  := range internal.Experiments {
		 = append(, &Experiment{
			Name:    ,
			Rollout: 100,
		})
	}
	sort.Slice(, func(,  int) bool { return [].Name < [].Name })
	 := map[string][]*Experiment{"experiments": }
	return yaml.Marshal(&)
}

func ( []byte) error {
	,  := os.Getwd()
	if  != nil {
		return 
	}
	 := strings.TrimSuffix(, "/devtools/cmd/run_beta") + "/experiment.yaml"
	,  := os.Create()
	if  != nil {
		return 
	}
Ignore f.Close() error, since f.Write returned an error.
		_ = .Close()
		return 
	}
	if  := .Close();  != nil {
		return 
	}
	fmt.Printf("Set `export GO_DISCOVERY_CONFIG_DYNAMIC=%q` to enable experiments.\n", )
	return nil