Ajout d'une panic en cas de clé hmac non renseignée

This commit is contained in:
Valentin Carroy 2024-09-11 10:18:18 +02:00
parent b6c26a2285
commit 1c0b02c9b4
1 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,9 @@ type Client struct {
} }
func NewClient(hmacKey string, maxNumber int64, algorithm string, salt string, expire string, checkExpire bool) *Client { func NewClient(hmacKey string, maxNumber int64, algorithm string, salt string, expire string, checkExpire bool) *Client {
if len(hmacKey) == 0 {
panic("HMAC key not found in env")
}
return &Client { return &Client {
hmacKey: hmacKey, hmacKey: hmacKey,
maxNumber: maxNumber, maxNumber: maxNumber,