Skip to content

Commit 11364d2

Browse files
committed
Reformat code using go fmt v 1.19
There are different format rules for Go 1.19, reformat the comments with the new version so that the formatting changes do not show up in unrelated merge requests.
1 parent 9a13243 commit 11364d2

31 files changed

+264
-250
lines changed

batch_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build all || cassandra
12
// +build all cassandra
23

34
package gocql

cass1batch_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build all || cassandra
12
// +build all cassandra
23

34
package gocql

cassandra_test.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func TestInvalidPeerEntry(t *testing.T) {
6868
}
6969
}
7070

71-
//TestUseStatementError checks to make sure the correct error is returned when the user tries to execute a use statement.
71+
// TestUseStatementError checks to make sure the correct error is returned when the user tries to execute a use statement.
7272
func TestUseStatementError(t *testing.T) {
7373
session := createSession(t)
7474
defer session.Close()
@@ -82,7 +82,7 @@ func TestUseStatementError(t *testing.T) {
8282
}
8383
}
8484

85-
//TestInvalidKeyspace checks that an invalid keyspace will return promptly and without a flood of connections
85+
// TestInvalidKeyspace checks that an invalid keyspace will return promptly and without a flood of connections
8686
func TestInvalidKeyspace(t *testing.T) {
8787
cluster := createCluster()
8888
cluster.Keyspace = "invalidKeyspace"
@@ -1190,7 +1190,7 @@ func TestRebindQueryInfo(t *testing.T) {
11901190
}
11911191
}
11921192

1193-
//TestStaticQueryInfo makes sure that the application can manually bind query parameters using the simplest possible static binding strategy
1193+
// TestStaticQueryInfo makes sure that the application can manually bind query parameters using the simplest possible static binding strategy
11941194
func TestStaticQueryInfo(t *testing.T) {
11951195
session := createSession(t)
11961196
defer session.Close()
@@ -1258,7 +1258,7 @@ func upcaseInitial(str string) string {
12581258
return ""
12591259
}
12601260

1261-
//TestBoundQueryInfo makes sure that the application can manually bind query parameters using the query meta data supplied at runtime
1261+
// TestBoundQueryInfo makes sure that the application can manually bind query parameters using the query meta data supplied at runtime
12621262
func TestBoundQueryInfo(t *testing.T) {
12631263

12641264
session := createSession(t)
@@ -1297,7 +1297,7 @@ func TestBoundQueryInfo(t *testing.T) {
12971297

12981298
}
12991299

1300-
//TestBatchQueryInfo makes sure that the application can manually bind query parameters when executing in a batch
1300+
// TestBatchQueryInfo makes sure that the application can manually bind query parameters when executing in a batch
13011301
func TestBatchQueryInfo(t *testing.T) {
13021302
session := createSession(t)
13031303
defer session.Close()
@@ -1475,7 +1475,7 @@ func TestQueryInfo(t *testing.T) {
14751475
}
14761476
}
14771477

1478-
//TestPreparedCacheEviction will make sure that the cache size is maintained
1478+
// TestPreparedCacheEviction will make sure that the cache size is maintained
14791479
func TestPrepare_PreparedCacheEviction(t *testing.T) {
14801480
const maxPrepared = 4
14811481

@@ -1614,7 +1614,7 @@ func TestPrepare_PreparedCacheKey(t *testing.T) {
16141614
}
16151615
}
16161616

1617-
//TestMarshalFloat64Ptr tests to see that a pointer to a float64 is marshalled correctly.
1617+
// TestMarshalFloat64Ptr tests to see that a pointer to a float64 is marshalled correctly.
16181618
func TestMarshalFloat64Ptr(t *testing.T) {
16191619
session := createSession(t)
16201620
defer session.Close()
@@ -1628,7 +1628,7 @@ func TestMarshalFloat64Ptr(t *testing.T) {
16281628
}
16291629
}
16301630

1631-
//TestMarshalInet tests to see that a pointer to a float64 is marshalled correctly.
1631+
// TestMarshalInet tests to see that a pointer to a float64 is marshalled correctly.
16321632
func TestMarshalInet(t *testing.T) {
16331633
session := createSession(t)
16341634
defer session.Close()
@@ -1788,7 +1788,7 @@ func TestVarint(t *testing.T) {
17881788
}
17891789
}
17901790

1791-
//TestQueryStats confirms that the stats are returning valid data. Accuracy may be questionable.
1791+
// TestQueryStats confirms that the stats are returning valid data. Accuracy may be questionable.
17921792
func TestQueryStats(t *testing.T) {
17931793
session := createSession(t)
17941794
defer session.Close()
@@ -1817,7 +1817,7 @@ func TestIterHost(t *testing.T) {
18171817
}
18181818
}
18191819

1820-
//TestBatchStats confirms that the stats are returning valid data. Accuracy may be questionable.
1820+
// TestBatchStats confirms that the stats are returning valid data. Accuracy may be questionable.
18211821
func TestBatchStats(t *testing.T) {
18221822
session := createSession(t)
18231823
defer session.Close()
@@ -1915,8 +1915,8 @@ func TestBatchObserve(t *testing.T) {
19151915
}
19161916
}
19171917

1918-
//TestNilInQuery tests to see that a nil value passed to a query is handled by Cassandra
1919-
//TODO validate the nil value by reading back the nil. Need to fix Unmarshalling.
1918+
// TestNilInQuery tests to see that a nil value passed to a query is handled by Cassandra
1919+
// TODO validate the nil value by reading back the nil. Need to fix Unmarshalling.
19201920
func TestNilInQuery(t *testing.T) {
19211921
session := createSession(t)
19221922
defer session.Close()

conn.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ func (p PasswordAuthenticator) Success(data []byte) error {
9191
// to true if no Config is set. Most users should set SslOptions.Config to a *tls.Config.
9292
// SslOptions and Config.InsecureSkipVerify interact as follows:
9393
//
94-
// Config.InsecureSkipVerify | EnableHostVerification | Result
95-
// Config is nil | false | do not verify host
96-
// Config is nil | true | verify host
97-
// false | false | verify host
98-
// true | false | do not verify host
99-
// false | true | verify host
100-
// true | true | verify host
94+
// Config.InsecureSkipVerify | EnableHostVerification | Result
95+
// Config is nil | false | do not verify host
96+
// Config is nil | true | verify host
97+
// false | false | verify host
98+
// true | false | do not verify host
99+
// false | true | verify host
100+
// true | true | verify host
101101
type SslOptions struct {
102102
*tls.Config
103103

connectionpool.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,15 @@ func (pool *hostConnPool) Pick() *Conn {
350350
return leastBusyConn
351351
}
352352

353-
//Size returns the number of connections currently active in the pool
353+
// Size returns the number of connections currently active in the pool
354354
func (pool *hostConnPool) Size() int {
355355
pool.mu.RLock()
356356
defer pool.mu.RUnlock()
357357

358358
return len(pool.conns)
359359
}
360360

361-
//Close the connection pool
361+
// Close the connection pool
362362
func (pool *hostConnPool) Close() {
363363
pool.mu.Lock()
364364

connectionpool_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build all || unit
12
// +build all unit
23

34
package gocql
@@ -9,8 +10,8 @@ import (
910

1011
func TestSetupTLSConfig(t *testing.T) {
1112
tests := []struct {
12-
name string
13-
opts *SslOptions
13+
name string
14+
opts *SslOptions
1415
expectedInsecureSkipVerify bool
1516
}{
1617
{
@@ -82,4 +83,3 @@ func TestSetupTLSConfig(t *testing.T) {
8283
})
8384
}
8485
}
85-

debug_off.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !gocql_debug
12
// +build !gocql_debug
23

34
package gocql

debug_on.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build gocql_debug
12
// +build gocql_debug
23

34
package gocql

0 commit comments

Comments
 (0)