Remove error return type from metric.New method#9116
Conversation
| @@ -227,11 +227,7 @@ func (p *parser) readDWMetrics(metricType string, dwms interface{}, metrics []te | |||
| parsed, err := p.seriesParser.Parse([]byte(measurementName)) | |||
There was a problem hiding this comment.
I'm wondering if this error needs to be returned instead?
There was a problem hiding this comment.
It looks like it's handled in the if statement two lines below, I'm unsure if that's what you meant though
There was a problem hiding this comment.
Yeah mainly just thought why are we nil checking it but then not either returning the error or logging it. I'm aware this isn't related to what you've changed so probably fine to leave it as is.
There was a problem hiding this comment.
I agree, although as it's out of scope for this PR I'll probably leave it. and thanks for reviewing!
There was a problem hiding this comment.
yeah this logic is definitely bad. there's a panic hiding in here too. You don't have to fix it in this PR, but please circle back to it and/or open an issue
|
!retry-checks |
* Remove error return type from metric.New method. * Formatting changes for linter + gofmt * Additional linter fixes. * More linter fixes. * Linter fix. * address comments
the
metric.Newmethod never returns an error, which led to a lot of unnecessary checks in the code. This PR removes the error return type from it and refactors the 94 files that referenced it.