diff --git a/sdks/go/pkg/beam/coder.go b/sdks/go/pkg/beam/coder.go index fe6be4728538..a6e1441e8c0b 100644 --- a/sdks/go/pkg/beam/coder.go +++ b/sdks/go/pkg/beam/coder.go @@ -374,11 +374,3 @@ func schemaDec(t reflect.Type, in []byte) (T, error) { } return val, nil } - -func newSchemaCoder(t reflect.Type) (*coder.CustomCoder, error) { - c, err := coder.NewCustomCoder("schema", t, schemaEnc, schemaDec) - if err != nil { - return nil, errors.Wrapf(err, "invalid coder") - } - return c, nil -} diff --git a/sdks/go/pkg/beam/core/graph/fn_test.go b/sdks/go/pkg/beam/core/graph/fn_test.go index 5f0e274b0840..9333db347342 100644 --- a/sdks/go/pkg/beam/core/graph/fn_test.go +++ b/sdks/go/pkg/beam/core/graph/fn_test.go @@ -13,6 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//lint:file-ignore U1000 unused functions/types are for tests + package graph import ( diff --git a/sdks/go/pkg/beam/core/runtime/exec/emit.go b/sdks/go/pkg/beam/core/runtime/exec/emit.go index e24b6925ed7b..c008b0b412d0 100644 --- a/sdks/go/pkg/beam/core/runtime/exec/emit.go +++ b/sdks/go/pkg/beam/core/runtime/exec/emit.go @@ -35,8 +35,9 @@ type ReusableEmitter interface { Value() interface{} } -// ReusableEmitter is a resettable value needed to hold the implicit context and -// emit event time. It also has the ability to have a watermark estimator attached. +// ReusableTimestampObservingWatermarkEmitter is a resettable value needed to hold +// the implicit context and emit event time. It also has the ability to have a +// watermark estimator attached. type ReusableTimestampObservingWatermarkEmitter interface { ReusableEmitter AttachEstimator(est *sdf.WatermarkEstimator) diff --git a/sdks/go/pkg/beam/core/runtime/genx/genx_test.go b/sdks/go/pkg/beam/core/runtime/genx/genx_test.go index 24f96a5bc7a9..17b690381570 100644 --- a/sdks/go/pkg/beam/core/runtime/genx/genx_test.go +++ b/sdks/go/pkg/beam/core/runtime/genx/genx_test.go @@ -13,6 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//lint:file-ignore U1000 unused functions/types are for tests + package genx import ( diff --git a/sdks/go/pkg/beam/core/runtime/graphx/schema/logicaltypes.go b/sdks/go/pkg/beam/core/runtime/graphx/schema/logicaltypes.go index 42bda4f79b6f..cea0cbbf76eb 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/schema/logicaltypes.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/schema/logicaltypes.go @@ -124,7 +124,6 @@ type LogicalType struct { identifier string goT, storageT, argT reflect.Type argV reflect.Value - toStorage, toGo func(value reflect.Value) reflect.Value } // ID is a unique identifier for the logical type. diff --git a/sdks/go/pkg/beam/core/runtime/graphx/schema/schema_test.go b/sdks/go/pkg/beam/core/runtime/graphx/schema/schema_test.go index ef66499de4ec..5ef2f707280a 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/schema/schema_test.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/schema/schema_test.go @@ -13,6 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//lint:file-ignore U1000 unused functions/types are for tests + package schema import ( diff --git a/sdks/go/pkg/beam/core/runtime/graphx/serialize_test.go b/sdks/go/pkg/beam/core/runtime/graphx/serialize_test.go index b1a3369e768e..cd0e6dda994f 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/serialize_test.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/serialize_test.go @@ -13,6 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//lint:file-ignore U1000 unused functions/types are for tests + package graphx import ( diff --git a/sdks/go/pkg/beam/core/runtime/graphx/translate.go b/sdks/go/pkg/beam/core/runtime/graphx/translate.go index b28820966a8a..d5c7a31b3e4c 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/translate.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/translate.go @@ -1248,12 +1248,6 @@ func mustEncodeMultiEdgeBase64(edge *graph.MultiEdge) (string, error) { }), nil } -// makeBytesKeyedCoder returns KV<[]byte,A,> for any coder, -// even if the coder is already a KV coder. -func makeBytesKeyedCoder(c *coder.Coder) *coder.Coder { - return coder.NewKV([]*coder.Coder{coder.NewBytes(), c}) -} - func edgeID(edge *graph.MultiEdge) string { return fmt.Sprintf("e%v", edge.ID()) } diff --git a/sdks/go/pkg/beam/core/runtime/graphx/xlang_test.go b/sdks/go/pkg/beam/core/runtime/graphx/xlang_test.go index a94fce634e69..7b68a7707682 100644 --- a/sdks/go/pkg/beam/core/runtime/graphx/xlang_test.go +++ b/sdks/go/pkg/beam/core/runtime/graphx/xlang_test.go @@ -145,12 +145,6 @@ func newComponents(ts []string) *pipepb.Components { return components } -func expectPanic(t *testing.T, err string) { - if r := recover(); r == nil { - t.Errorf("expected panic; %v", err) - } -} - func TestExpandedTransform(t *testing.T) { t.Run("Correct PTransform", func(t *testing.T) { want := newTransform("x") diff --git a/sdks/go/pkg/beam/core/runtime/types_test.go b/sdks/go/pkg/beam/core/runtime/types_test.go index ed9b9e9606ae..b301df6da14f 100644 --- a/sdks/go/pkg/beam/core/runtime/types_test.go +++ b/sdks/go/pkg/beam/core/runtime/types_test.go @@ -13,6 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//lint:file-ignore U1000 unused functions/types are for tests + package runtime import ( diff --git a/sdks/go/pkg/beam/io/xlang/jdbcio/jdbc.go b/sdks/go/pkg/beam/io/xlang/jdbcio/jdbc.go index 6938c51c2018..a027e00c5db0 100644 --- a/sdks/go/pkg/beam/io/xlang/jdbcio/jdbc.go +++ b/sdks/go/pkg/beam/io/xlang/jdbcio/jdbc.go @@ -69,8 +69,6 @@ var defaultClasspaths = map[string][]string{ "com.mysql.jdbc.Driver": []string{"mysql:mysql-connector-java:8.0.28"}, } -var autoStartupAddress string = xlangx.UseAutomatedJavaExpansionService(serviceGradleTarget) - // jdbcConfigSchema is the config schema as per the expected corss language payload // for JDBC IO read and write transform. type jdbcConfigSchema struct { diff --git a/sdks/go/pkg/beam/staticcheck.conf b/sdks/go/pkg/beam/staticcheck.conf index e4a182b22f43..5da9745a7a0c 100644 --- a/sdks/go/pkg/beam/staticcheck.conf +++ b/sdks/go/pkg/beam/staticcheck.conf @@ -17,6 +17,4 @@ # analysis tool. See https://staticcheck.io/docs/checks/ for descriptions of # each check. -# TODO(BEAM-14371): Clean up instances of S1021 (merge variable declaration and assignment) and enable check -# TODO(BEAM-14372): Clean up instances of U1000 (unused fields, vars, functions) and enable check -checks = ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-ST1023", "-SA1019", "-U1000", "-S1021"] \ No newline at end of file +checks = ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1022", "-ST1023", "-SA1019", "-S1021"] \ No newline at end of file diff --git a/sdks/go/pkg/beam/transforms/sql/sqlx/sqlx.go b/sdks/go/pkg/beam/transforms/sql/sqlx/sqlx.go index 7e537a4cbd98..2f050a14432c 100644 --- a/sdks/go/pkg/beam/transforms/sql/sqlx/sqlx.go +++ b/sdks/go/pkg/beam/transforms/sql/sqlx/sqlx.go @@ -13,6 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//lint:file-ignore U1000 unused type options in ExpansionPayload struct is needed to maintain +// correct expected serialized payload + // Package sqlx contains "internal" SQL transform interfaces that are needed // by the SQL expansion providers. //