Skip to content

Commit

Permalink
fix(query): address staticcheck warning S1020 (#18136)
Browse files Browse the repository at this point in the history
Quiet staicccheck warning "should merge variable declaration with
assignment on next line (S1021)" by updating point.gen.go.tmpl and
re-generating point.gen.go.
  • Loading branch information
ayang64 authored May 19, 2020
1 parent 6be2b37 commit 9dae8c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
20 changes: 5 additions & 15 deletions query/point.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ func (dec *FloatPointDecoder) DecodeFloatPoint(p *FloatPoint) error {
}

if len(pb.Trace) > 0 {
var err error
err = decodeIteratorTrace(dec.ctx, pb.Trace)
if err != nil {
if err := decodeIteratorTrace(dec.ctx, pb.Trace); err != nil {
return err
}
continue
Expand Down Expand Up @@ -450,9 +448,7 @@ func (dec *IntegerPointDecoder) DecodeIntegerPoint(p *IntegerPoint) error {
}

if len(pb.Trace) > 0 {
var err error
err = decodeIteratorTrace(dec.ctx, pb.Trace)
if err != nil {
if err := decodeIteratorTrace(dec.ctx, pb.Trace); err != nil {
return err
}
continue
Expand Down Expand Up @@ -673,9 +669,7 @@ func (dec *UnsignedPointDecoder) DecodeUnsignedPoint(p *UnsignedPoint) error {
}

if len(pb.Trace) > 0 {
var err error
err = decodeIteratorTrace(dec.ctx, pb.Trace)
if err != nil {
if err := decodeIteratorTrace(dec.ctx, pb.Trace); err != nil {
return err
}
continue
Expand Down Expand Up @@ -898,9 +892,7 @@ func (dec *StringPointDecoder) DecodeStringPoint(p *StringPoint) error {
}

if len(pb.Trace) > 0 {
var err error
err = decodeIteratorTrace(dec.ctx, pb.Trace)
if err != nil {
if err := decodeIteratorTrace(dec.ctx, pb.Trace); err != nil {
return err
}
continue
Expand Down Expand Up @@ -1123,9 +1115,7 @@ func (dec *BooleanPointDecoder) DecodeBooleanPoint(p *BooleanPoint) error {
}

if len(pb.Trace) > 0 {
var err error
err = decodeIteratorTrace(dec.ctx, pb.Trace)
if err != nil {
if err := decodeIteratorTrace(dec.ctx, pb.Trace); err != nil {
return err
}
continue
Expand Down
4 changes: 1 addition & 3 deletions query/point.gen.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,7 @@ func (dec *{{.Name}}PointDecoder) Decode{{.Name}}Point(p *{{.Name}}Point) error
}

if len(pb.Trace) > 0 {
var err error
err = decodeIteratorTrace(dec.ctx, pb.Trace)
if err != nil {
if err := decodeIteratorTrace(dec.ctx, pb.Trace); err != nil {
return err
}
continue
Expand Down

0 comments on commit 9dae8c9

Please sign in to comment.