mirror of
https://github.com/prometheus/prometheus.git
synced 2026-04-15 22:09:39 -04:00
build: update golangci-lint version to v2.11.4
fix(promql/parser): improve Pretty method for Expressions to handle empty cases Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
parent
9a3ac8910b
commit
6798e4ca3c
2 changed files with 10 additions and 5 deletions
|
|
@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
|
|||
SKIP_GOLANGCI_LINT :=
|
||||
GOLANGCI_LINT :=
|
||||
GOLANGCI_LINT_OPTS ?=
|
||||
GOLANGCI_LINT_VERSION ?= v2.10.1
|
||||
GOLANGCI_LINT_VERSION ?= v2.11.4
|
||||
GOLANGCI_FMT_OPTS ?=
|
||||
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
|
||||
# windows isn't included here because of the path separator being different.
|
||||
|
|
|
|||
|
|
@ -111,11 +111,16 @@ func (e *EvalStmt) Pretty(int) string {
|
|||
|
||||
func (e Expressions) Pretty(level int) string {
|
||||
// Do not prefix the indent since respective nodes will indent itself.
|
||||
s := ""
|
||||
for i := range e {
|
||||
s += fmt.Sprintf("%s,\n", e[i].Pretty(level))
|
||||
if len(e) == 0 {
|
||||
return ""
|
||||
}
|
||||
return s[:len(s)-2]
|
||||
|
||||
parts := make([]string, len(e))
|
||||
for i := range e {
|
||||
parts[i] = e[i].Pretty(level)
|
||||
}
|
||||
|
||||
return strings.Join(parts, ",\n")
|
||||
}
|
||||
|
||||
func (e *ParenExpr) Pretty(level int) string {
|
||||
|
|
|
|||
Loading…
Reference in a new issue