Skip to content

Commit

Permalink
Start errors with lowercase letter
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-sucha committed Oct 25, 2020
1 parent 5913df4 commit 5393dd6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion control.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func hostInfo(addr string, defaultPort int) ([]*HostInfo, error) {
if err != nil {
return nil, err
} else if len(ips) == 0 {
return nil, fmt.Errorf("No IP's returned from DNS lookup for %q", addr)
return nil, fmt.Errorf("no IP's returned from DNS lookup for %q", addr)
}

// Filter to v4 addresses if any present
Expand Down
4 changes: 2 additions & 2 deletions frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ func (w *writePrepareFrame) writeFrame(f *framer, streamID int) error {
if f.proto > protoVersion4 {
flags |= flagWithPreparedKeyspace
} else {
panic(fmt.Errorf("The keyspace can only be set with protocol 5 or higher"))
panic(fmt.Errorf("the keyspace can only be set with protocol 5 or higher"))
}
}
if f.proto > protoVersion4 {
Expand Down Expand Up @@ -1502,7 +1502,7 @@ func (f *framer) writeQueryParams(opts *queryParams) {
if f.proto > protoVersion4 {
flags |= flagWithKeyspace
} else {
panic(fmt.Errorf("The keyspace can only be set with protocol 5 or higher"))
panic(fmt.Errorf("the keyspace can only be set with protocol 5 or higher"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestRingDiscovery(t *testing.T) {
t.Logf("p=%q host=%v ips=%s", p, pool.host, pool.host.ConnectAddress().String())

}
t.Errorf("Expected a cluster size of %d, but actual size was %d", *clusterSize, size)
t.Errorf("expected a cluster size of %d, but actual size was %d", *clusterSize, size)
}
}

Expand Down
4 changes: 2 additions & 2 deletions marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ func unmarshalUUID(info TypeInfo, data []byte, value interface{}) error {

u, err := UUIDFromBytes(data)
if err != nil {
return unmarshalErrorf("Unable to parse UUID: %s", err)
return unmarshalErrorf("unable to parse UUID: %s", err)
}

switch v := value.(type) {
Expand Down Expand Up @@ -2050,7 +2050,7 @@ func marshalUDT(info TypeInfo, value interface{}) ([]byte, error) {
case Marshaler:
return v.MarshalCQL(info)
case unsetColumn:
return nil, unmarshalErrorf("Invalid request: UnsetValue is unsupported for user defined types")
return nil, unmarshalErrorf("invalid request: UnsetValue is unsupported for user defined types")
case UDTMarshaler:
var buf []byte
for _, e := range udt.Elements {
Expand Down
18 changes: 9 additions & 9 deletions metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func getKeyspaceMetadata(session *Session, keyspaceName string) (*KeyspaceMetada
iter.Scan(&keyspace.DurableWrites, &replication)
err := iter.Close()
if err != nil {
return nil, fmt.Errorf("Error querying keyspace schema: %v", err)
return nil, fmt.Errorf("error querying keyspace schema: %v", err)
}

keyspace.StrategyClass = replication["class"]
Expand All @@ -585,13 +585,13 @@ func getKeyspaceMetadata(session *Session, keyspaceName string) (*KeyspaceMetada
iter.Scan(&keyspace.DurableWrites, &keyspace.StrategyClass, &strategyOptionsJSON)
err := iter.Close()
if err != nil {
return nil, fmt.Errorf("Error querying keyspace schema: %v", err)
return nil, fmt.Errorf("error querying keyspace schema: %v", err)
}

err = json.Unmarshal(strategyOptionsJSON, &keyspace.StrategyOptions)
if err != nil {
return nil, fmt.Errorf(
"Invalid JSON value '%s' as strategy_options for in keyspace '%s': %v",
"invalid JSON value '%s' as strategy_options for in keyspace '%s': %v",
strategyOptionsJSON, keyspace.Name, err,
)
}
Expand Down Expand Up @@ -703,7 +703,7 @@ func getTableMetadata(session *Session, keyspaceName string) ([]TableMetadata, e
if err != nil {
iter.Close()
return nil, fmt.Errorf(
"Invalid JSON value '%s' as key_aliases for in table '%s': %v",
"invalid JSON value '%s' as key_aliases for in table '%s': %v",
keyAliasesJSON, table.Name, err,
)
}
Expand All @@ -716,7 +716,7 @@ func getTableMetadata(session *Session, keyspaceName string) ([]TableMetadata, e
if err != nil {
iter.Close()
return nil, fmt.Errorf(
"Invalid JSON value '%s' as column_aliases for in table '%s': %v",
"invalid JSON value '%s' as column_aliases for in table '%s': %v",
columnAliasesJSON, table.Name, err,
)
}
Expand All @@ -728,7 +728,7 @@ func getTableMetadata(session *Session, keyspaceName string) ([]TableMetadata, e

err := iter.Close()
if err != nil && err != ErrNotFound {
return nil, fmt.Errorf("Error querying table schema: %v", err)
return nil, fmt.Errorf("error querying table schema: %v", err)
}

return tables, nil
Expand Down Expand Up @@ -777,7 +777,7 @@ func (s *Session) scanColumnMetadataV1(keyspace string) ([]ColumnMetadata, error
err := json.Unmarshal(indexOptionsJSON, &column.Index.Options)
if err != nil {
return nil, fmt.Errorf(
"Invalid JSON value '%s' as index_options for column '%s' in table '%s': %v",
"invalid JSON value '%s' as index_options for column '%s' in table '%s': %v",
indexOptionsJSON,
column.Name,
column.Table,
Expand Down Expand Up @@ -837,7 +837,7 @@ func (s *Session) scanColumnMetadataV2(keyspace string) ([]ColumnMetadata, error
err := json.Unmarshal(indexOptionsJSON, &column.Index.Options)
if err != nil {
return nil, fmt.Errorf(
"Invalid JSON value '%s' as index_options for column '%s' in table '%s': %v",
"invalid JSON value '%s' as index_options for column '%s' in table '%s': %v",
indexOptionsJSON,
column.Name,
column.Table,
Expand Down Expand Up @@ -915,7 +915,7 @@ func getColumnMetadata(session *Session, keyspaceName string) ([]ColumnMetadata,
}

if err != nil && err != ErrNotFound {
return nil, fmt.Errorf("Error querying column schema: %v", err)
return nil, fmt.Errorf("error querying column schema: %v", err)
}

return columns, nil
Expand Down
2 changes: 1 addition & 1 deletion token.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func newTokenRing(partitioner string, hosts []*HostInfo) (*tokenRing, error) {
} else if strings.HasSuffix(partitioner, "RandomPartitioner") {
tokenRing.partitioner = randomPartitioner{}
} else {
return nil, fmt.Errorf("Unsupported partitioner '%s'", partitioner)
return nil, fmt.Errorf("unsupported partitioner '%s'", partitioner)
}

for _, host := range hosts {
Expand Down

0 comments on commit 5393dd6

Please sign in to comment.