// SetEnvVars sets additional environment variables to be exported by the context.
348658
func (ctx *limitedContext) SetEnvVars(vars map[string]string) {
	if ctx.env == nil {
		ctx.env = vars
		return
	}
	for key, val := range vars {
		ctx.env[key] = val
	}
}
1136855
func (s *Project) SetEnvironment(v *ProjectEnvironment) *Project {
	s.Environment = v
	return s
}
651836
func (client *Client) SetEnvironment(environment string) {
	client.mu.Lock()
	defer client.mu.Unlock()
	client.environment = environment
}
1024475
func (s *EventDescription) SetEnvironmentName(v string) *EventDescription {
	s.EnvironmentName = &v
	return s
}
151063
func (ev *EnvVars) Restore() {
	for key, value := range ev.vars {
		if err := os.Setenv(key, value); err != nil {
			msg := fmt.Sprintf("cannot reset environment variable %q: %v", key, err)
			ev.assert.Fail(msg)
		}
	}
}
610596
func (c *Gcd) AddEnvironmentVars(vars []string) {
	c.env = append(c.env, vars...)
}
1183689
func (s *UpdateAppInput) SetEnvironment(v []*EnvironmentVariable) *UpdateAppInput {
	s.Environment = v
	return s
}
405045
func setUserEnv(ctx *cli.Context) error {
	argName := "environment"
	// Check for env flag, just in case this middleware is misused
	hasEnvFlag := false
	for _, name := range ctx.FlagNames() {
		if name == argName {
			hasEnvFlag = true
			break
		}
	}
	if !hasEnvFlag {
		return nil
	}

	if isSet(ctx, argName) {
		return nil
	}

	cfg, err := config.LoadConfig()
	if err != nil {
		return err
	}

	client := api.NewClient(cfg)
	session, err := client.Session.Who(context.Background())
	if err != nil {
		return err
	}

	if session.Type() == apitypes.UserSession {
		ctx.Set(argName, "dev-"+session.Username())
	}

	return nil
}
1235281
func (s *UpdateBranchInput) SetEnvironmentVariables(v map[string]*string) *UpdateBranchInput {
	s.EnvironmentVariables = v
	return s
}
35451
func (s *CreateTransformJobInput) SetEnvironment(v map[string]*string) *CreateTransformJobInput {
	s.Environment = v
	return s
}
1363013
func SetEnvVariable(key, value string) error {
	if strings.TrimSpace(value) == "" {
		return nil
	}
	err := os.Setenv(key, value)
	if err != nil {
		return fmt.Errorf("Failed to set: %s = %s. %s", key, value, err.Error())
	}
	return nil
}
948941
func (s *EnvironmentDescriptionsMessage) SetEnvironments(v []*EnvironmentDescription) *EnvironmentDescriptionsMessage {
	s.Environments = v
	return s
}
134968
func setupEnvironmentVariables(a []string) map[string]string {
	r := make(map[string]string)
	for _, s := range a {
		arr := strings.SplitN(s, "=", 2)
		if len(arr) == 2 {
			r[arr[0]] = arr[1]
		}
	}
	return r
}
33636
func LoadEnvVariables() {
	if os.Getenv("GONI_PROMODE") == "true" || EnableProductionMode {
		gin.SetMode(gin.ReleaseMode)
	}

	if os.Getenv("GONI_REST") == "false" {
		EnableRestAPI = false
	}

	if os.Getenv("GONI_STREAM") == "false" {
		EnableStreamAPI = false
	}
}
1309022
func (s *DescribeEnvironmentResourcesOutput) SetEnvironmentResources(v *EnvironmentResourceDescription) *DescribeEnvironmentResourcesOutput {
	s.EnvironmentResources = v
	return s
}
899945
func SetenvForFunction(envKey, envValue string, fn func()) error {
	revokeFn, err := RevokableSetenv(envKey, envValue)
	if err != nil {
		return err
	}

	fn()

	return revokeFn()
}
531050
func (e EnvDetails) SetSensuEnv() *EnvDetails {
	envFile, err := ioutil.ReadFile(sensuutil.EnvironmentFile)
	if err != nil {
		panic(err)
	}

	err = json.Unmarshal(envFile, &e)
	if err != nil {
		panic(err)
	}
	return &e
}