-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: upgrade staticcheck, fix new linter warnings #21957
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -499,7 +499,7 @@ type Stats struct { | |
NTags int | ||
} | ||
|
||
func (s Stats) Update(o Stats) { | ||
func (s Stats) Update(o Stats) Stats { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: This method does a lot of updates to the fields of |
||
s.NRows += o.NRows | ||
if s.Latest.IsZero() || o.Latest.Unix() > s.Latest.Unix() { | ||
s.Latest = o.Latest | ||
|
@@ -516,6 +516,7 @@ func (s Stats) Update(o Stats) { | |
if o.NTags > s.NTags { | ||
s.NTags = o.NTags | ||
} | ||
return s | ||
} | ||
|
||
func writeTable(ctx context.Context, t *ToTransformation, tbl flux.Table) (err error) { | ||
|
@@ -654,11 +655,10 @@ func writeTable(ctx context.Context, t *ToTransformation, tbl flux.Table) (err e | |
NTags: len(kv) / 2, | ||
} | ||
_, ok := measurementStats[measurementName] | ||
if !ok { | ||
measurementStats[measurementName] = mstats | ||
} else { | ||
measurementStats[measurementName].Update(mstats) | ||
if ok { | ||
mstats = measurementStats[measurementName].Update(mstats) | ||
} | ||
measurementStats[measurementName] = mstats | ||
|
||
tags, _ = models.NewTagsKeyValues(tags, kv...) | ||
pt, err := models.NewPoint(measurementName, tags, fields, pointTime) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nitpick