diff --git a/rules/mapping.go b/rules/mapping.go index 88f6ad6..78f1a7b 100644 --- a/rules/mapping.go +++ b/rules/mapping.go @@ -32,9 +32,9 @@ import ( ) var ( - errMappingRuleSnapshotIdxOutOfRange = errors.New("mapping rule snapshot index out of range") - errNilMappingRuleSnapshotSchema = errors.New("nil mapping rule snapshot schema") - errNilMappingRuleSchema = errors.New("nil mapping rule schema") + errMappingRuleSnapshotIndexOutOfRange = errors.New("mapping rule snapshot index out of range") + errNilMappingRuleSnapshotSchema = errors.New("nil mapping rule snapshot schema") + errNilMappingRuleSchema = errors.New("nil mapping rule schema") ) // mappingRuleSnapshot defines a rule snapshot such that if a metric matches the @@ -147,7 +147,7 @@ type MappingRuleView struct { func (mc *mappingRule) mappingRuleView(snapshotIdx int) (*MappingRuleView, error) { if snapshotIdx < 0 || snapshotIdx >= len(mc.snapshots) { - return nil, errMappingRuleSnapshotIdxOutOfRange + return nil, errMappingRuleSnapshotIndexOutOfRange } mrs := mc.snapshots[snapshotIdx].clone() diff --git a/rules/namespace.go b/rules/namespace.go index b262ef1..37b66fe 100644 --- a/rules/namespace.go +++ b/rules/namespace.go @@ -32,16 +32,16 @@ var ( emptyNamespace Namespace emptyNamespaces Namespaces - errNamespaceSnapshotIdxOutOfRange = errors.New("namespace snapshot idx out of range") - errNilNamespaceSnapshotSchema = errors.New("nil namespace snapshot schema") - errNilNamespaceSchema = errors.New("nil namespace schema") - errNilNamespacesSchema = errors.New("nil namespaces schema") - errNilNamespaceSnapshot = errors.New("nil namespace snapshot") - errMultipleNamespaceMatches = errors.New("more than one namespace match found") - errNamespaceNotFound = errors.New("namespace not found") - errNamespaceNotTombstoned = errors.New("not tombstoned") - errNamespaceTombstoned = errors.New("already tombstoned") - errNoNamespaceSnapshots = errors.New("no snapshots") + errNamespaceSnapshotIndexOutOfRange = errors.New("namespace snapshot idx out of range") + errNilNamespaceSnapshotSchema = errors.New("nil namespace snapshot schema") + errNilNamespaceSchema = errors.New("nil namespace schema") + errNilNamespacesSchema = errors.New("nil namespaces schema") + errNilNamespaceSnapshot = errors.New("nil namespace snapshot") + errMultipleNamespaceMatches = errors.New("more than one namespace match found") + errNamespaceNotFound = errors.New("namespace not found") + errNamespaceNotTombstoned = errors.New("not tombstoned") + errNamespaceTombstoned = errors.New("already tombstoned") + errNoNamespaceSnapshots = errors.New("no snapshots") namespaceActionErrorFmt = "cannot %s namespace %s. %v" ) @@ -110,7 +110,7 @@ type NamespaceView struct { func (n Namespace) namespaceView(snapshotIdx int) (*NamespaceView, error) { if snapshotIdx < 0 || snapshotIdx >= len(n.snapshots) { - return nil, errNamespaceSnapshotIdxOutOfRange + return nil, errNamespaceSnapshotIndexOutOfRange } s := n.snapshots[snapshotIdx] return &NamespaceView{ diff --git a/rules/rollup.go b/rules/rollup.go index 3ce4cd2..5e3ff4d 100644 --- a/rules/rollup.go +++ b/rules/rollup.go @@ -36,10 +36,10 @@ import ( var ( emptyRollupTarget RollupTarget - errRollupRuleSnapshotIdxOutOfRange = errors.New("rollup rule snapshot index out of range") - errNilRollupTargetSchema = errors.New("nil rollup target schema") - errNilRollupRuleSnapshotSchema = errors.New("nil rollup rule snapshot schema") - errNilRollupRuleSchema = errors.New("nil rollup rule schema") + errRollupRuleSnapshotIndexOutOfRange = errors.New("rollup rule snapshot index out of range") + errNilRollupTargetSchema = errors.New("nil rollup target schema") + errNilRollupRuleSnapshotSchema = errors.New("nil rollup rule snapshot schema") + errNilRollupRuleSchema = errors.New("nil rollup rule schema") ) // RollupTarget dictates how to roll up metrics. Metrics associated with a rollup @@ -269,7 +269,7 @@ type RollupRuleView struct { func (rc *rollupRule) rollupRuleView(snapshotIdx int) (*RollupRuleView, error) { if snapshotIdx < 0 || snapshotIdx >= len(rc.snapshots) { - return nil, errRollupRuleSnapshotIdxOutOfRange + return nil, errRollupRuleSnapshotIndexOutOfRange } rrs := rc.snapshots[snapshotIdx].clone()