mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-13 07:11:13 +00:00
no trailing comma on label list
This commit is contained in:
@@ -272,11 +272,11 @@ func extractHelpMessage(cg *ast.CommentGroup) string {
|
||||
}
|
||||
var help []string
|
||||
for _, c := range cg.List {
|
||||
mt := strings.TrimPrefix(str, "//metrics:")
|
||||
if mt != c {
|
||||
mt := strings.TrimPrefix(c.Text, "//metrics:")
|
||||
if mt != c.Text {
|
||||
return strings.TrimSpace(mt)
|
||||
}
|
||||
help = append(help, strings.TrimSpace(strings.TrimPrefix(c, "//")))
|
||||
help = append(help, strings.TrimSpace(strings.TrimPrefix(c.Text, "//")))
|
||||
}
|
||||
return strings.Join(help, " ")
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ func TestParseMetricsStruct(t *testing.T) {
|
||||
TypeName: "Counter",
|
||||
FieldName: "myCounter",
|
||||
MetricName: "my_counter",
|
||||
Labels: "\"label1\",\"label2\",",
|
||||
Labels: "\"label1\",\"label2\"",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user