mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-20 10:55:07 +00:00
feat: fix the linter 🤖
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
12
pkg/cache/interplex_based.go
vendored
12
pkg/cache/interplex_based.go
vendored
@@ -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{
|
||||||
|
Reference in New Issue
Block a user