feat: fix the linter 🤖

Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
Alex Jones
2025-04-24 15:46:22 +01:00
parent 6a4b0db4d1
commit b6cd4c9cdf

View File

@@ -3,11 +3,13 @@ package cache
import ( import (
"context" "context"
"errors" "errors"
"fmt"
"os" "os"
rpc "buf.build/gen/go/interplex-ai/schemas/grpc/go/protobuf/schema/v1/schemav1grpc" rpc "buf.build/gen/go/interplex-ai/schemas/grpc/go/protobuf/schema/v1/schemav1grpc"
schemav1 "buf.build/gen/go/interplex-ai/schemas/protocolbuffers/go/protobuf/schema/v1" schemav1 "buf.build/gen/go/interplex-ai/schemas/protocolbuffers/go/protobuf/schema/v1"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
) )
var _ ICache = (*InterplexCache)(nil) var _ ICache = (*InterplexCache)(nil)
@@ -91,11 +93,17 @@ func (c *InterplexCache) Remove(key string) error {
c.configuration.ConnectionString = "localhost:8084" c.configuration.ConnectionString = "localhost:8084"
} }
conn, err := grpc.NewClient(c.configuration.ConnectionString, grpc.WithInsecure(), grpc.WithBlock()) conn, err := grpc.NewClient(c.configuration.ConnectionString, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
defer conn.Close()
if err != nil { if err != nil {
return err return err
} }
defer func() {
if err := conn.Close(); err != nil {
// Log the error but don't return it since this is a deferred function
fmt.Printf("Error closing connection: %v\n", err)
}
}()
serviceClient := rpc.NewCacheServiceClient(conn) serviceClient := rpc.NewCacheServiceClient(conn)
c.cacheServiceClient = serviceClient c.cacheServiceClient = serviceClient
req := schemav1.DeleteRequest{ req := schemav1.DeleteRequest{