Skip to content

Commit

Permalink
move error definitions out of consts file
Browse files Browse the repository at this point in the history
other stringer fails due to:

golang/go#10249

Signed-off-by: Madhav Puri <[email protected]>
  • Loading branch information
mapuri committed Mar 23, 2016
1 parent ea90b9f commit d4aa4bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions management/src/inventory/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ var description = map[AssetState]string{
Disappeared: "Node has disappeared from monitoring subsystem. Check for possible hardware or network issues",
}

var (
errAssetExists = func(tag string) error { return errored.Errorf("asset %q already exists", tag) }
errAssetNotExists = func(tag string) error { return errored.Errorf("asset %q doesn't exists", tag) }
)

// collinsStatusMap maps the status strings to corresponding enumerated values
var collinsStatusMap = map[string]AssetStatus{
Incomplete.String(): Incomplete,
Expand Down
7 changes: 0 additions & 7 deletions management/src/inventory/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package inventory

import "github.com/contiv/errored"

// AssetStatus enumerates all the possible lifecycle status of asset in collins
type AssetStatus int

Expand Down Expand Up @@ -53,8 +51,3 @@ const (
// Disappeared state denotes that host has disappeared from monitoring subsystem.
Disappeared
)

var (
errAssetExists = func(tag string) error { return errored.Errorf("asset %q already exists", tag) }
errAssetNotExists = func(tag string) error { return errored.Errorf("asset %q doesn't exists", tag) }
)

0 comments on commit d4aa4bc

Please sign in to comment.