From a3b7e69d06b9293f9ffcd253d660fef514e6ed45 Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Fri, 22 Nov 2024 17:32:56 +0200 Subject: [PATCH] chore: delete unused code --- .github/workflows/unit-tests.yml | 4 ++-- driver_with_mockserver_test.go | 7 ------- integration_test.go | 6 ------ merged_row_iterator.go | 6 ------ statement_parser.go | 3 +-- stmt.go | 9 ++++----- testutil/mocked_inmem_server.go | 2 -- 7 files changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 2e7f65c5..c24fc7be 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -64,8 +64,8 @@ jobs: - name: staticcheck ./examples working-directory: ./examples - run: staticcheck -checks "inherit,-U1000" ./... + run: staticcheck ./... - name: staticcheck ./benchmarks working-directory: ./benchmarks - run: staticcheck -checks "inherit,-U1000" ./... + run: staticcheck ./... diff --git a/driver_with_mockserver_test.go b/driver_with_mockserver_test.go index 6dc54a54..fb0a649b 100644 --- a/driver_with_mockserver_test.go +++ b/driver_with_mockserver_test.go @@ -4764,13 +4764,6 @@ func date(v string) civil.Date { return res } -func nullDate(valid bool, v string) spanner.NullDate { - if !valid { - return spanner.NullDate{} - } - return spanner.NullDate{Valid: true, Date: date(v)} -} - func nullJson(valid bool, v string) spanner.NullJSON { if !valid { return spanner.NullJSON{} diff --git a/integration_test.go b/integration_test.go index a7a97743..24c0297c 100644 --- a/integration_test.go +++ b/integration_test.go @@ -264,12 +264,6 @@ func skipIfShort(t *testing.T) { } } -func skipIfEmulator(t *testing.T, msg string) { - if runsOnEmulator() { - t.Skip(msg) - } -} - func TestQueryContext(t *testing.T) { skipIfShort(t) t.Parallel() diff --git a/merged_row_iterator.go b/merged_row_iterator.go index 0a37f561..f1a43ade 100644 --- a/merged_row_iterator.go +++ b/merged_row_iterator.go @@ -168,12 +168,6 @@ func (m *mergedRowIterator) produceRowsFromPartition(ctx context.Context, index } } -func (m *mergedRowIterator) isStopped() bool { - m.mu.Lock() - defer m.mu.Unlock() - return m.err != nil -} - func (m *mergedRowIterator) hasErr() bool { m.mu.Lock() defer m.mu.Unlock() diff --git a/statement_parser.go b/statement_parser.go index 20162545..a64c518f 100644 --- a/statement_parser.go +++ b/statement_parser.go @@ -840,8 +840,7 @@ type clientSideStatement struct { ResultType string `json:"resultType"` Regex string `json:"regex"` regexp *regexp.Regexp - MethodName string `json:"method"` - method func(query string) error + MethodName string `json:"method"` ExampleStatements []string `json:"exampleStatements"` ExamplePrerequisiteStatements []string `json:"examplePrerequisiteStatements"` diff --git a/stmt.go b/stmt.go index a845b4f6..33a02382 100644 --- a/stmt.go +++ b/stmt.go @@ -29,11 +29,10 @@ var _ driver.StmtQueryContext = &stmt{} var _ driver.NamedValueChecker = &stmt{} type stmt struct { - conn *conn - numArgs int - query string - statementType statementType - execOptions ExecOptions + conn *conn + numArgs int + query string + execOptions ExecOptions } func (s *stmt) Close() error { diff --git a/testutil/mocked_inmem_server.go b/testutil/mocked_inmem_server.go index 5bf012ff..f5a6ae6a 100644 --- a/testutil/mocked_inmem_server.go +++ b/testutil/mocked_inmem_server.go @@ -39,8 +39,6 @@ const selectDialect = "select option_value from information_schema.database_opti // server and will return a one-col-two-rows result set containing the INT64 // values 1 and 2. const SelectFooFromBar = "SELECT FOO FROM BAR" -const selectFooFromBarRowCount int64 = 2 -const selectFooFromBarColCount int = 1 var selectFooFromBarResults = []int64{1, 2}