Merge pull request #1624 from dmitris/golint

(trivial) fix several minor golint style issues
This commit is contained in:
Brian Brazil 2016-05-11 14:20:19 +01:00
commit 68aaea618a
4 changed files with 14 additions and 16 deletions

View file

@ -42,7 +42,7 @@ const (
subsystem = "notifications" subsystem = "notifications"
) )
// Handler is responsible for dispatching alert notifications to an // Notifier is responsible for dispatching alert notifications to an
// alert manager service. // alert manager service.
type Notifier struct { type Notifier struct {
queue model.Alerts queue model.Alerts
@ -61,7 +61,7 @@ type Notifier struct {
queueCapacity prometheus.Metric queueCapacity prometheus.Metric
} }
// HandlerOptions are the configurable parameters of a Handler. // Options are the configurable parameters of a Handler.
type Options struct { type Options struct {
AlertmanagerURL string AlertmanagerURL string
QueueCapacity int QueueCapacity int

View file

@ -82,8 +82,7 @@ func (i itemType) isSetOperator() bool {
return false return false
} }
// Constants for operator precedence in expressions. // LowestPrec is a constant for operator precedence in expressions.
//
const LowestPrec = 0 // Non-operators. const LowestPrec = 0 // Non-operators.
// Precedence returns the operator precedence of the binary // Precedence returns the operator precedence of the binary

View file

@ -512,17 +512,16 @@ func (p *parser) balance(lhs Expr, op itemType, rhs Expr, vecMatching *VectorMat
VectorMatching: lhsBE.VectorMatching, VectorMatching: lhsBE.VectorMatching,
ReturnBool: lhsBE.ReturnBool, ReturnBool: lhsBE.ReturnBool,
} }
} else { }
if op.isComparisonOperator() && !returnBool && rhs.Type() == model.ValScalar && lhs.Type() == model.ValScalar { if op.isComparisonOperator() && !returnBool && rhs.Type() == model.ValScalar && lhs.Type() == model.ValScalar {
p.errorf("comparisons between scalars must use BOOL modifier") p.errorf("comparisons between scalars must use BOOL modifier")
} }
return &BinaryExpr{ return &BinaryExpr{
Op: op, Op: op,
LHS: lhs, LHS: lhs,
RHS: rhs, RHS: rhs,
VectorMatching: vecMatching, VectorMatching: vecMatching,
ReturnBool: returnBool, ReturnBool: returnBool,
}
} }
} }

View file

@ -51,7 +51,7 @@ func pathFromMetric(m model.Metric, prefix string) string {
// We want to sort the labels. // We want to sort the labels.
labels := make(model.LabelNames, 0, len(m)) labels := make(model.LabelNames, 0, len(m))
for l, _ := range m { for l := range m {
labels = append(labels, l) labels = append(labels, l)
} }
sort.Sort(labels) sort.Sort(labels)