From ab846d4b90ed0f14cd248572e573148e113bec2a Mon Sep 17 00:00:00 2001 From: Auto Gofmt Date: Wed, 5 Jun 2024 08:53:44 +0000 Subject: [PATCH] Automated gofmt changes --- integration-tests/virtualization_test.go | 28 ++++++++++--------- proxy/pkg/zdmproxy/queryinspector.go | 34 +++++++++++++----------- proxy/pkg/zdmproxy/querymodifier.go | 4 +-- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/integration-tests/virtualization_test.go b/integration-tests/virtualization_test.go index 0e23ead2..243080e4 100644 --- a/integration-tests/virtualization_test.go +++ b/integration-tests/virtualization_test.go @@ -340,6 +340,7 @@ func TestVirtualizationTokenAwareness(t *testing.T) { cqlsh> describe system.local; #3.11 CREATE TABLE system.local ( + key text PRIMARY KEY, bootstrapped text, broadcast_address inet, @@ -358,21 +359,22 @@ CREATE TABLE system.local ( thrift_version text, tokens set, truncated_at map + ) - cqlsh> describe system.peers; - #3.11 - CREATE TABLE system.peers ( - peer inet PRIMARY KEY, - data_center text, - host_id uuid, - preferred_ip inet, - rack text, - release_version text, - rpc_address inet, - schema_version uuid, - tokens set - ) + cqlsh> describe system.peers; + #3.11 + CREATE TABLE system.peers ( + peer inet PRIMARY KEY, + data_center text, + host_id uuid, + preferred_ip inet, + rack text, + release_version text, + rpc_address inet, + schema_version uuid, + tokens set + ) */ func TestInterceptedQueries(t *testing.T) { testSetup, err := setup.NewSimulacronTestSetupWithSessionAndNodes(t, false, false, 3) diff --git a/proxy/pkg/zdmproxy/queryinspector.go b/proxy/pkg/zdmproxy/queryinspector.go index 43e4d997..3616dcc0 100644 --- a/proxy/pkg/zdmproxy/queryinspector.go +++ b/proxy/pkg/zdmproxy/queryinspector.go @@ -170,23 +170,25 @@ func (recv *selectClause) GetSelectors() []selector { } // selector represents a selector in the cql grammar. 'term' and 'K_CAST' selectors are not supported. -// selector -// : unaliasedSelector ( K_AS identifier )? -// ; // -// unaliasedSelector -// : identifier -// | term -// | K_COUNT '(' '*' ')' -// | K_CAST '(' unaliasedSelector K_AS primitiveType ')' -// ; +// selector +// : unaliasedSelector ( K_AS identifier )? +// ; +// +// unaliasedSelector +// : identifier +// | term +// | K_COUNT '(' '*' ')' +// | K_CAST '(' unaliasedSelector K_AS primitiveType ')' +// ; type selector interface { Name() string } // idSelector represents an unaliased identifier selector: -// unaliasedSelector -// : identifier +// +// unaliasedSelector +// : identifier type idSelector struct { name string } @@ -196,7 +198,8 @@ func (recv *idSelector) Name() string { } // countSelector represents an unaliased count(*) selector: -// K_COUNT '(' '*' ')' +// +// K_COUNT '(' '*' ')' type countSelector struct { name string } @@ -206,9 +209,10 @@ func (recv *countSelector) Name() string { } // aliasedSelector represents an unaliased selector combined with an alias: -// selector -// : unaliasedSelector ( K_AS identifier )? -// ; +// +// selector +// : unaliasedSelector ( K_AS identifier )? +// ; type aliasedSelector struct { selector selector alias string diff --git a/proxy/pkg/zdmproxy/querymodifier.go b/proxy/pkg/zdmproxy/querymodifier.go index 10c7c3fc..91eb9c05 100644 --- a/proxy/pkg/zdmproxy/querymodifier.go +++ b/proxy/pkg/zdmproxy/querymodifier.go @@ -17,8 +17,8 @@ func NewQueryModifier(timeUuidGenerator TimeUuidGenerator) *QueryModifier { } // replaceQueryString modifies the incoming request in certain conditions: -// * the request is a QUERY or PREPARE -// * and it contains now() function calls +// - the request is a QUERY or PREPARE +// - and it contains now() function calls func (recv *QueryModifier) replaceQueryString(currentKeyspace string, context *frameDecodeContext) (*frameDecodeContext, []*statementReplacedTerms, error) { decodedFrame, statementsQueryData, err := context.GetOrDecodeAndInspect(currentKeyspace, recv.timeUuidGenerator) if err != nil {