MCPcopy
hub / github.com/psviderski/uncloud / CreateContext

Method CreateContext

internal/cli/cli.go:58–66  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

56}
57
58func (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
68func (cli *CLI) SetCurrentContext(name string) error {
69 if _, ok := cli.Config.Contexts[name]; !ok {

Callers 1

initRemoteMachineMethod · 0.95

Calls 2

ErrorfMethod · 0.80
SaveMethod · 0.45

Tested by

no test coverage detected