[BEAM-14371] (and BEAM-14372) - enable a couple staticchecks (#17670) · tomstepp/apache-beam@780ad62

13 files changed

lines changed

Lines changed: 0 additions & 8 deletions

Original file line numberDiff line numberDiff line change

@@ -374,11 +374,3 @@ func schemaDec(t reflect.Type, in []byte) (T, error) {

374374

}

375375

return val, nil

376376

}

377-
378-

func newSchemaCoder(t reflect.Type) (*coder.CustomCoder, error) {

379-

c, err := coder.NewCustomCoder("schema", t, schemaEnc, schemaDec)

380-

if err != nil {

381-

return nil, errors.Wrapf(err, "invalid coder")

382-

}

383-

return c, nil

384-

}

Lines changed: 2 additions & 0 deletions

Original file line numberDiff line numberDiff line change

@@ -13,6 +13,8 @@

1313

// See the License for the specific language governing permissions and

1414

// limitations under the License.

1515
16+

//lint:file-ignore U1000 unused functions/types are for tests

17+
1618

package graph

1719
1820

import (

Lines changed: 3 additions & 2 deletions

Original file line numberDiff line numberDiff line change

@@ -35,8 +35,9 @@ type ReusableEmitter interface {

3535

Value() interface{}

3636

}

3737
38-

// ReusableEmitter is a resettable value needed to hold the implicit context and

39-

// emit event time. It also has the ability to have a watermark estimator attached.

38+

// ReusableTimestampObservingWatermarkEmitter is a resettable value needed to hold

39+

// the implicit context and emit event time. It also has the ability to have a

40+

// watermark estimator attached.

4041

type ReusableTimestampObservingWatermarkEmitter interface {

4142

ReusableEmitter

4243

AttachEstimator(est *sdf.WatermarkEstimator)

Lines changed: 2 additions & 0 deletions

Original file line numberDiff line numberDiff line change

@@ -13,6 +13,8 @@

1313

// See the License for the specific language governing permissions and

1414

// limitations under the License.

1515
16+

//lint:file-ignore U1000 unused functions/types are for tests

17+
1618

package genx

1719
1820

import (

Lines changed: 0 additions & 1 deletion

Original file line numberDiff line numberDiff line change

@@ -124,7 +124,6 @@ type LogicalType struct {

124124

identifier string

125125

goT, storageT, argT reflect.Type

126126

argV reflect.Value

127-

toStorage, toGo func(value reflect.Value) reflect.Value

128127

}

129128
130129

// ID is a unique identifier for the logical type.

Lines changed: 2 additions & 0 deletions

Original file line numberDiff line numberDiff line change

@@ -13,6 +13,8 @@

1313

// See the License for the specific language governing permissions and

1414

// limitations under the License.

1515
16+

//lint:file-ignore U1000 unused functions/types are for tests

17+
1618

package schema

1719
1820

import (

Lines changed: 2 additions & 0 deletions

Original file line numberDiff line numberDiff line change

@@ -13,6 +13,8 @@

1313

// See the License for the specific language governing permissions and

1414

// limitations under the License.

1515
16+

//lint:file-ignore U1000 unused functions/types are for tests

17+
1618

package graphx

1719
1820

import (

Lines changed: 0 additions & 6 deletions

Original file line numberDiff line numberDiff line change

@@ -1248,12 +1248,6 @@ func mustEncodeMultiEdgeBase64(edge *graph.MultiEdge) (string, error) {

12481248

}), nil

12491249

}

12501250
1251-

// makeBytesKeyedCoder returns KV<[]byte,A,> for any coder,

1252-

// even if the coder is already a KV coder.

1253-

func makeBytesKeyedCoder(c *coder.Coder) *coder.Coder {

1254-

return coder.NewKV([]*coder.Coder{coder.NewBytes(), c})

1255-

}

1256-
12571251

func edgeID(edge *graph.MultiEdge) string {

12581252

return fmt.Sprintf("e%v", edge.ID())

12591253

}

Lines changed: 0 additions & 6 deletions

Original file line numberDiff line numberDiff line change

@@ -145,12 +145,6 @@ func newComponents(ts []string) *pipepb.Components {

145145

return components

146146

}

147147
148-

func expectPanic(t *testing.T, err string) {

149-

if r := recover(); r == nil {

150-

t.Errorf("expected panic; %v", err)

151-

}

152-

}

153-
154148

func TestExpandedTransform(t *testing.T) {

155149

t.Run("Correct PTransform", func(t *testing.T) {

156150

want := newTransform("x")

Lines changed: 2 additions & 0 deletions

Original file line numberDiff line numberDiff line change

@@ -13,6 +13,8 @@

1313

// See the License for the specific language governing permissions and

1414

// limitations under the License.

1515
16+

//lint:file-ignore U1000 unused functions/types are for tests

17+
1618

package runtime

1719
1820

import (