mirror of
https://github.com/gofiber/storage.git
synced 2025-10-04 16:22:52 +08:00
Updated Nitpicks
This commit is contained in:
@@ -9,7 +9,7 @@ title: Aerospike
|
||||
|
||||
A Aerospike client driver using `aerospike/aerospike-client-go` and [aerospike/aerospike-client-go](https://github.com/aerospike/aerospike-client-go).
|
||||
|
||||
**Note: Requires Go 1.19 and above**
|
||||
**Note: Requires Go 1.23 and above**
|
||||
|
||||
### Table of Contents
|
||||
- [Signatures](#signatures)
|
||||
|
@@ -16,6 +16,10 @@ const (
|
||||
aerospikeNamespace = "test"
|
||||
)
|
||||
|
||||
// setupAerospikeTestClient sets up a test Aerospike client
|
||||
// using testcontainers-go. It starts an Aerospike container and returns
|
||||
// a Storage instance configured to connect to the container.
|
||||
// The container is cleaned up after the test completes.
|
||||
func setupAerospikeTestClient(t *testing.T) *Storage {
|
||||
t.Helper()
|
||||
|
||||
@@ -26,6 +30,8 @@ func setupAerospikeTestClient(t *testing.T) *Storage {
|
||||
t.Fatalf("Failed to start aerospike container: %v", err)
|
||||
}
|
||||
|
||||
testcontainers.CleanupContainer(t, c)
|
||||
|
||||
// Extract host and port
|
||||
host, err := c.Host(context.TODO())
|
||||
if err != nil {
|
||||
@@ -37,11 +43,6 @@ func setupAerospikeTestClient(t *testing.T) *Storage {
|
||||
t.Fatalf("Failed to get container port: %v", err)
|
||||
}
|
||||
|
||||
testcontainers.CleanupContainer(t, c)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to cleanup Aerospike container: %v", err)
|
||||
}
|
||||
|
||||
return New(Config{
|
||||
Hosts: []*aerospike.Host{aerospike.NewHost(host, port.Int())},
|
||||
Reset: true,
|
||||
@@ -70,7 +71,7 @@ func Test_AeroSpikeDB_Get(t *testing.T) {
|
||||
require.Equal(t, val, retrievedVal)
|
||||
}
|
||||
|
||||
// Test_AeroSpikeDB_Set tests the Set method
|
||||
// Test_AeroSpikeDB_Delete tests the Delete method
|
||||
func Test_AeroSpikeDB_Delete(t *testing.T) {
|
||||
|
||||
var (
|
||||
|
Reference in New Issue
Block a user