From c94ccf3d4f36fd339c03ec2f1a7d4bd5b6faad98 Mon Sep 17 00:00:00 2001 From: "Homayoon (Hue) Alimohammadi" Date: Wed, 9 Oct 2024 18:15:14 +0400 Subject: [PATCH] Fix lint --- pkg/token/token.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/token/token.go b/pkg/token/token.go index a536c21..2d6e225 100644 --- a/pkg/token/token.go +++ b/pkg/token/token.go @@ -68,7 +68,7 @@ func getSecret(ctx context.Context, c client.Client, clusterKey client.ObjectKey func generateAndStore(ctx context.Context, c client.Client, clusterKey client.ObjectKey) (*corev1.Secret, error) { token, err := randomB64(16) if err != nil { - return nil, fmt.Errorf("failed to generate token: %v", err) + return nil, fmt.Errorf("failed to generate token: %w", err) } secret := &corev1.Secret{ @@ -82,7 +82,7 @@ func generateAndStore(ctx context.Context, c client.Client, clusterKey client.Ob } if err := c.Create(ctx, secret); err != nil { - return nil, fmt.Errorf("failed to create secret: %v", err) + return nil, fmt.Errorf("failed to create secret: %w", err) } return secret, nil @@ -93,7 +93,7 @@ func randomB64(n int) (string, error) { b := make([]byte, n) _, err := cryptorand.Read(b) if err != nil { - return "", fmt.Errorf("failed to read random bytes: %v", err) + return "", fmt.Errorf("failed to read random bytes: %w", err) } return base64.StdEncoding.EncodeToString(b), nil }