mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-28 20:13:33 +00:00
remove duplicate ErrNotFound in client
This commit is contained in:
+1
-5
@@ -17,10 +17,6 @@ import (
|
|||||||
|
|
||||||
const defaultClusterName = "default"
|
const defaultClusterName = "default"
|
||||||
|
|
||||||
var (
|
|
||||||
ErrNotFound = errors.New("not found")
|
|
||||||
)
|
|
||||||
|
|
||||||
type CLI struct {
|
type CLI struct {
|
||||||
config *config.Config
|
config *config.Config
|
||||||
}
|
}
|
||||||
@@ -47,7 +43,7 @@ func (cli *CLI) CreateCluster(name string) error {
|
|||||||
|
|
||||||
func (cli *CLI) SetCurrentCluster(name string) error {
|
func (cli *CLI) SetCurrentCluster(name string) error {
|
||||||
if _, ok := cli.config.Clusters[name]; !ok {
|
if _, ok := cli.config.Clusters[name]; !ok {
|
||||||
return ErrNotFound
|
return client.ErrNotFound
|
||||||
}
|
}
|
||||||
cli.config.CurrentCluster = name
|
cli.config.CurrentCluster = name
|
||||||
return cli.config.Save()
|
return cli.config.Save()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"uncloud/internal/machine/docker"
|
"uncloud/internal/machine/docker"
|
||||||
)
|
)
|
||||||
|
|
||||||
var NotFound = errors.New("not found")
|
var ErrNotFound = errors.New("not found")
|
||||||
|
|
||||||
// Client is a client for the machine API.
|
// Client is a client for the machine API.
|
||||||
type Client struct {
|
type Client struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user