CI: Add code linting (#118)

This commit is contained in:
Knut Ahlers 2023-10-04 22:53:29 +02:00 committed by GitHub
parent 546481dcfc
commit 8540d4016c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 200 additions and 14 deletions

View file

@ -53,14 +53,14 @@ func (s storageRedis) ReadAndDestroy(id string) (string, error) {
if errors.Is(err, redis.Nil) {
return "", errSecretNotFound
}
return "", err
return "", errors.Wrap(err, "getting key")
}
err = s.conn.Del(context.Background(), s.redisKey(id)).Err()
return string(secret), errors.Wrap(err, "deleting key")
return secret, errors.Wrap(err, "deleting key")
}
func (s storageRedis) redisKey(id string) string {
func (storageRedis) redisKey(id string) string {
prefix := redisDefaultPrefix
if prfx := os.Getenv("REDIS_KEY"); prfx != "" {
prefix = prfx