Skip to content

Commit

Permalink
fix several minor golint style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Savintsev committed May 11, 2016
1 parent ba87e2d commit 7fdb62c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const (
subsystem = "notifications"
)

// Handler is responsible for dispatching alert notifications to an
// Notifier is responsible for dispatching alert notifications to an
// alert manager service.
type Notifier struct {
queue model.Alerts
Expand All @@ -61,7 +61,7 @@ type Notifier struct {
queueCapacity prometheus.Metric
}

// HandlerOptions are the configurable parameters of a Handler.
// Options are the configurable parameters of a Handler.
type Options struct {
AlertmanagerURL string
QueueCapacity int
Expand Down
3 changes: 1 addition & 2 deletions promql/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ func (i itemType) isSetOperator() bool {
return false
}

// Constants for operator precedence in expressions.
//
// LowestPrec is a constant for operator precedence in expressions.
const LowestPrec = 0 // Non-operators.

// Precedence returns the operator precedence of the binary
Expand Down
21 changes: 10 additions & 11 deletions promql/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,17 +512,16 @@ func (p *parser) balance(lhs Expr, op itemType, rhs Expr, vecMatching *VectorMat
VectorMatching: lhsBE.VectorMatching,
ReturnBool: lhsBE.ReturnBool,
}
} else {
if op.isComparisonOperator() && !returnBool && rhs.Type() == model.ValScalar && lhs.Type() == model.ValScalar {
p.errorf("comparisons between scalars must use BOOL modifier")
}
return &BinaryExpr{
Op: op,
LHS: lhs,
RHS: rhs,
VectorMatching: vecMatching,
ReturnBool: returnBool,
}
}
if op.isComparisonOperator() && !returnBool && rhs.Type() == model.ValScalar && lhs.Type() == model.ValScalar {
p.errorf("comparisons between scalars must use BOOL modifier")
}
return &BinaryExpr{
Op: op,
LHS: lhs,
RHS: rhs,
VectorMatching: vecMatching,
ReturnBool: returnBool,
}
}

Expand Down
2 changes: 1 addition & 1 deletion storage/remote/graphite/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func pathFromMetric(m model.Metric, prefix string) string {

// We want to sort the labels.
labels := make(model.LabelNames, 0, len(m))
for l, _ := range m {
for l := range m {
labels = append(labels, l)
}
sort.Sort(labels)
Expand Down

0 comments on commit 7fdb62c

Please sign in to comment.