Skip to content

Commit

Permalink
Reformat code using go fmt v 1.19
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martin-sucha committed Sep 6, 2022
1 parent 9a13243 commit 11364d2
Show file tree
Hide file tree
Showing 31 changed files with 264 additions and 250 deletions.
1 change: 1 addition & 0 deletions batch_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build all || cassandra
// +build all cassandra

package gocql
Expand Down
1 change: 1 addition & 0 deletions cass1batch_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build all || cassandra
// +build all cassandra

package gocql
Expand Down
24 changes: 12 additions & 12 deletions cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestInvalidPeerEntry(t *testing.T) {
}
}

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

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

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

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

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

}

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

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

Expand Down Expand Up @@ -1614,7 +1614,7 @@ func TestPrepare_PreparedCacheKey(t *testing.T) {
}
}

//TestMarshalFloat64Ptr tests to see that a pointer to a float64 is marshalled correctly.
// TestMarshalFloat64Ptr tests to see that a pointer to a float64 is marshalled correctly.
func TestMarshalFloat64Ptr(t *testing.T) {
session := createSession(t)
defer session.Close()
Expand All @@ -1628,7 +1628,7 @@ func TestMarshalFloat64Ptr(t *testing.T) {
}
}

//TestMarshalInet tests to see that a pointer to a float64 is marshalled correctly.
// TestMarshalInet tests to see that a pointer to a float64 is marshalled correctly.
func TestMarshalInet(t *testing.T) {
session := createSession(t)
defer session.Close()
Expand Down Expand Up @@ -1788,7 +1788,7 @@ func TestVarint(t *testing.T) {
}
}

//TestQueryStats confirms that the stats are returning valid data. Accuracy may be questionable.
// TestQueryStats confirms that the stats are returning valid data. Accuracy may be questionable.
func TestQueryStats(t *testing.T) {
session := createSession(t)
defer session.Close()
Expand Down Expand Up @@ -1817,7 +1817,7 @@ func TestIterHost(t *testing.T) {
}
}

//TestBatchStats confirms that the stats are returning valid data. Accuracy may be questionable.
// TestBatchStats confirms that the stats are returning valid data. Accuracy may be questionable.
func TestBatchStats(t *testing.T) {
session := createSession(t)
defer session.Close()
Expand Down Expand Up @@ -1915,8 +1915,8 @@ func TestBatchObserve(t *testing.T) {
}
}

//TestNilInQuery tests to see that a nil value passed to a query is handled by Cassandra
//TODO validate the nil value by reading back the nil. Need to fix Unmarshalling.
// TestNilInQuery tests to see that a nil value passed to a query is handled by Cassandra
// TODO validate the nil value by reading back the nil. Need to fix Unmarshalling.
func TestNilInQuery(t *testing.T) {
session := createSession(t)
defer session.Close()
Expand Down
14 changes: 7 additions & 7 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ func (p PasswordAuthenticator) Success(data []byte) error {
// to true if no Config is set. Most users should set SslOptions.Config to a *tls.Config.
// SslOptions and Config.InsecureSkipVerify interact as follows:
//
// Config.InsecureSkipVerify | EnableHostVerification | Result
// Config is nil | false | do not verify host
// Config is nil | true | verify host
// false | false | verify host
// true | false | do not verify host
// false | true | verify host
// true | true | verify host
// Config.InsecureSkipVerify | EnableHostVerification | Result
// Config is nil | false | do not verify host
// Config is nil | true | verify host
// false | false | verify host
// true | false | do not verify host
// false | true | verify host
// true | true | verify host
type SslOptions struct {
*tls.Config

Expand Down
4 changes: 2 additions & 2 deletions connectionpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,15 @@ func (pool *hostConnPool) Pick() *Conn {
return leastBusyConn
}

//Size returns the number of connections currently active in the pool
// Size returns the number of connections currently active in the pool
func (pool *hostConnPool) Size() int {
pool.mu.RLock()
defer pool.mu.RUnlock()

return len(pool.conns)
}

//Close the connection pool
// Close the connection pool
func (pool *hostConnPool) Close() {
pool.mu.Lock()

Expand Down
6 changes: 3 additions & 3 deletions connectionpool_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build all || unit
// +build all unit

package gocql
Expand All @@ -9,8 +10,8 @@ import (

func TestSetupTLSConfig(t *testing.T) {
tests := []struct {
name string
opts *SslOptions
name string
opts *SslOptions
expectedInsecureSkipVerify bool
}{
{
Expand Down Expand Up @@ -82,4 +83,3 @@ func TestSetupTLSConfig(t *testing.T) {
})
}
}

1 change: 1 addition & 0 deletions debug_off.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !gocql_debug
// +build !gocql_debug

package gocql
Expand Down
1 change: 1 addition & 0 deletions debug_on.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build gocql_debug
// +build gocql_debug

package gocql
Expand Down
Loading

0 comments on commit 11364d2

Please sign in to comment.