Skip to content

Commit

Permalink
Fix makefile lint/format targets
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-congo committed Feb 21, 2024
1 parent 9f76bad commit 28ead19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
3 changes: 2 additions & 1 deletion go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ lint:
if [ "$$(goimports -l . | wc -l)" -gt 0 ]; then exit 1; fi

format:
golines -w --shorten-comments -m 127 .
gofumpt -w .
golines -w --shorten-comments -m 127 .
goimports -w .

unit-test-report:
mkdir -p reports
Expand Down
32 changes: 8 additions & 24 deletions go/api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ func (config *RedisClientConfiguration) toProtobufConnRequest() (*protobuf.Conne
// Host: "sample-address-0001.use1.cache.amazonaws.com", Port: 6379}).
// WithAddress(&NodeAddress{
// Host: "sample-address-0002.use1.cache.amazonaws.com", Port: 6379})
func (config *RedisClientConfiguration) WithAddress(
address *NodeAddress,
) *RedisClientConfiguration {
func (config *RedisClientConfiguration) WithAddress(address *NodeAddress) *RedisClientConfiguration {
config.addresses = append(config.addresses, *address)
return config
}
Expand All @@ -211,9 +209,7 @@ func (config *RedisClientConfiguration) WithUseTLS(useTLS bool) *RedisClientConf

// WithCredentials sets the credentials for the authentication process. If none are set, the client will not authenticate
// itself with the server.
func (config *RedisClientConfiguration) WithCredentials(
credentials *RedisCredentials,
) *RedisClientConfiguration {
func (config *RedisClientConfiguration) WithCredentials(credentials *RedisCredentials) *RedisClientConfiguration {
config.credentials = credentials
return config
}
Expand All @@ -228,18 +224,14 @@ func (config *RedisClientConfiguration) WithReadFrom(readFrom ReadFrom) *RedisCl
// encompasses sending the request, awaiting for a response from the server, and any required reconnections or retries. If the
// specified timeout is exceeded for a pending request, it will result in a timeout error. If not set, a default value will be
// used.
func (config *RedisClientConfiguration) WithRequestTimeout(
requestTimeout uint32,
) *RedisClientConfiguration {
func (config *RedisClientConfiguration) WithRequestTimeout(requestTimeout uint32) *RedisClientConfiguration {
config.requestTimeout = &requestTimeout
return config
}

// WithReconnectStrategy sets the [BackoffStrategy] used to determine how and when to reconnect, in case of connection
// failures. If not set, a default backoff strategy will be used.
func (config *RedisClientConfiguration) WithReconnectStrategy(
strategy *BackoffStrategy,
) *RedisClientConfiguration {
func (config *RedisClientConfiguration) WithReconnectStrategy(strategy *BackoffStrategy) *RedisClientConfiguration {
config.reconnectStrategy = strategy
return config
}
Expand Down Expand Up @@ -285,19 +277,15 @@ func (config *RedisClusterClientConfiguration) toProtobufConnRequest() (*protobu
// Host: "sample-address-0001.use1.cache.amazonaws.com", Port: 6379}).
// WithAddress(&NodeAddress{
// Host: "sample-address-0002.use1.cache.amazonaws.com", Port: 6379})
func (config *RedisClusterClientConfiguration) WithAddress(
address NodeAddress,
) *RedisClusterClientConfiguration {
func (config *RedisClusterClientConfiguration) WithAddress(address NodeAddress) *RedisClusterClientConfiguration {
config.addresses = append(config.addresses, address)
return config
}

// WithUseTLS configures the TLS settings for this configuration. Set to true if communication with the cluster should use
// Transport Level Security. This setting should match the TLS configuration of the server/cluster, otherwise the connection
// attempt will fail.
func (config *RedisClusterClientConfiguration) WithUseTLS(
useTLS bool,
) *RedisClusterClientConfiguration {
func (config *RedisClusterClientConfiguration) WithUseTLS(useTLS bool) *RedisClusterClientConfiguration {
config.useTLS = useTLS
return config
}
Expand All @@ -312,9 +300,7 @@ func (config *RedisClusterClientConfiguration) WithCredentials(
}

// WithReadFrom sets the client's [ReadFrom] strategy. If not set, [Primary] will be used.
func (config *RedisClusterClientConfiguration) WithReadFrom(
readFrom ReadFrom,
) *RedisClusterClientConfiguration {
func (config *RedisClusterClientConfiguration) WithReadFrom(readFrom ReadFrom) *RedisClusterClientConfiguration {
config.readFrom = readFrom
return config
}
Expand All @@ -323,9 +309,7 @@ func (config *RedisClusterClientConfiguration) WithReadFrom(
// encompasses sending the request, awaiting for a response from the server, and any required reconnections or retries. If the
// specified timeout is exceeded for a pending request, it will result in a timeout error. If not set, a default value will be
// used.
func (config *RedisClusterClientConfiguration) WithRequestTimeout(
requestTimeout uint32,
) *RedisClusterClientConfiguration {
func (config *RedisClusterClientConfiguration) WithRequestTimeout(requestTimeout uint32) *RedisClusterClientConfiguration {
config.requestTimeout = &requestTimeout
return config
}

0 comments on commit 28ead19

Please sign in to comment.