(name string)
| 56 | } |
| 57 | |
| 58 | func (cli *CLI) CreateContext(name string) error { |
| 59 | if _, ok := cli.Config.Contexts[name]; ok { |
| 60 | return fmt.Errorf("context '%s' already exists", name) |
| 61 | } |
| 62 | cli.Config.Contexts[name] = &config.Context{ |
| 63 | Name: name, |
| 64 | } |
| 65 | return cli.Config.Save() |
| 66 | } |
| 67 | |
| 68 | func (cli *CLI) SetCurrentContext(name string) error { |
| 69 | if _, ok := cli.Config.Contexts[name]; !ok { |
no test coverage detected