func (this *Configuration) SetCurrentEnvironmentParam(key EnvironmentKey, value string) {
	env := this.CurrentEnvironmentP()
	switch key {
	case Profile:
		env.Profile = value
	case Region:
		env.Region = value
	}
	this.save()
	return
}
SetCurrentProfile sets profile name in current Environment.
package config
import (
	"errors"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	homedir "github.com/mitchellh/go-homedir"
	yaml "gopkg.in/yaml.v2"
)
const FileName = ".lazy-awslogs"
type Stream struct {
	Name string
}
type Group struct {
	Name    string
	Streams []Stream
}
type Environment struct {
	Name    string
	Profile string
	Region  string
	Groups  []Group
}
type Configuration struct {
	Current      string
	Environments []Environment
}
type EnvironmentKey int
const (
	Name EnvironmentKey = iota
	Profile
	Region
)
func Load() (c Configuration) {
	err := yaml.Unmarshal(configurationOpen(), &c)
	if err != nil {
		log.Fatalf("error: %v", err)
		os.Exit(1)
	}
	return
}
func (this *Configuration) save() {
	encodedBytes, _ := yaml.Marshal(&this)
	ioutil.WriteFile(configurationFilePath(), encodedBytes, 0644)
}
func configurationOpen() []byte {
	filename := configurationFilePath()
	if _, err := os.Stat(filename); err != nil {
		return nil
	}
	file, err := ioutil.ReadFile(filename)
	if err != nil {
		log.Fatalf("error: %v", err)
		os.Exit(1)
	}
	return file
}
func configurationFilePath() string {
	home, err := homedir.Dir()
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
	return filepath.Join(home, FileName+".yaml")
}
func (this *Configuration) CurrentEnvironment() (environment Environment) {
	for i, env := range this.Environments {
		if env.Name == this.Current {
			environment = this.Environments[i]
			break
		}
	}
	return
}
func (this *Configuration) CurrentEnvironmentP() (environment *Environment) {
	for i, env := range this.Environments {
		if env.Name == this.Current {
			environment = &this.Environments[i]
			break
		}
	}
	return
}
func (this *Configuration) UpdateCurrent(current string) (err error) {
	exist := false
	for _, env := range this.Environments {
		if env.Name == current {
			this.Current = current
			exist = true
			this.save()
			break
		}
	}
	if !exist {
		err = errors.New(current + " is not exist.")
	}
	return
}