diff --git a/client.go b/client.go index ae0732c3..206ab30d 100644 --- a/client.go +++ b/client.go @@ -95,25 +95,25 @@ type Client struct { id string } -// Option is a functional option that allows configuring the [Client]. -type Option func(*Client) +// ClientOpt is a functional option that allows configuring the [Client]. +type ClientOpt func(*Client) // WithID sets the ID for the Client. -func WithID(id string) Option { +func WithID(id string) ClientOpt { return func(c *Client) { c.id = id } } // WithLogger sets the logger for the [Client]. -func WithLogger(logger *slog.Logger) Option { +func WithLogger(logger *slog.Logger) ClientOpt { return func(c *Client) { c.logger = logger } } // WithScanLimiter sets the scan limiter for the [Client]. -func WithScanLimiter(sem *semaphore.Weighted) Option { +func WithScanLimiter(sem *semaphore.Weighted) ClientOpt { return func(c *Client) { c.scanLimiter = sem } @@ -128,7 +128,7 @@ func WithScanLimiter(sem *semaphore.Weighted) Option { // - [WithScanLimiter] to set a semaphore that is used to limit number of // concurrent scans. // - scan limiter semaphore that is used to limit number of concurrent scans. -func NewClient(ac AerospikeClient, opts ...Option) (*Client, error) { +func NewClient(ac AerospikeClient, opts ...ClientOpt) (*Client, error) { if ac == nil { return nil, errors.New("aerospike client pointer is nil") } diff --git a/examples/aws/s3/main.go b/examples/aws/s3/main.go index 9d918ba3..a5cf0bf9 100644 --- a/examples/aws/s3/main.go +++ b/examples/aws/s3/main.go @@ -17,10 +17,11 @@ package main import ( "context" "fmt" + "log" + "github.com/aerospike/aerospike-client-go/v7" "github.com/aerospike/backup-go" "github.com/aerospike/backup-go/io/aws/s3" - "log" ) const ( diff --git a/examples/readme/main.go b/examples/readme/main.go index d231dee4..fb95943f 100644 --- a/examples/readme/main.go +++ b/examples/readme/main.go @@ -16,9 +16,10 @@ package main import ( "context" + "log" + "github.com/aerospike/aerospike-client-go/v7" "github.com/aerospike/backup-go" - "log" ) func main() { diff --git a/io/aerospike/record_reader_test.go b/io/aerospike/record_reader_test.go index bc85cfe2..3c11d076 100644 --- a/io/aerospike/record_reader_test.go +++ b/io/aerospike/record_reader_test.go @@ -71,7 +71,7 @@ func (suite *readersTestSuite) TestAerospikeRecordReader() { ) reader := NewRecordReader( - context.TODO(), + context.Background(), mockScanner, &RecordReaderConfig{ namespace: namespace, @@ -126,7 +126,7 @@ func (suite *readersTestSuite) TestAerospikeRecordReaderRecordResError() { ) reader := NewRecordReader( - context.TODO(), + context.Background(), mockScanner, &RecordReaderConfig{ namespace: namespace, @@ -166,7 +166,7 @@ func (suite *readersTestSuite) TestAerospikeRecordReaderClosedChannel() { ) reader := NewRecordReader( - context.TODO(), + context.Background(), mockScanner, &RecordReaderConfig{ namespace: namespace, @@ -200,7 +200,7 @@ func (suite *readersTestSuite) TestAerospikeRecordReaderReadFailed() { ) reader := NewRecordReader( - context.TODO(), + context.Background(), mockScanner, &RecordReaderConfig{ namespace: namespace, @@ -259,7 +259,7 @@ func (suite *readersTestSuite) TestAerospikeRecordReaderWithPolicy() { ) reader := NewRecordReader( - context.TODO(), + context.Background(), mockScanner, &RecordReaderConfig{ namespace: namespace,