From 90b6170b557d401942287ae8d2288d511df44fd4 Mon Sep 17 00:00:00 2001 From: Roman Sarvarov Date: Thu, 10 Oct 2024 21:10:51 +0300 Subject: [PATCH] fix linter --- context.go | 8 ++++---- option.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/context.go b/context.go index aa9284b..2003e35 100644 --- a/context.go +++ b/context.go @@ -93,8 +93,8 @@ func SetEncryptHistory(ctx context.Context, encrypt ...bool) context.Context { // EncryptHistoryFromContext returns history encryption value from the context. func EncryptHistoryFromContext(ctx context.Context) (bool, bool) { - encrypt, ok := ctx.Value(encryptHistoryContextKey).(bool) - return encrypt, ok + encryptHistory, ok := ctx.Value(encryptHistoryContextKey).(bool) + return encryptHistory, ok } // SetClearHistory cleaning history state. @@ -104,9 +104,9 @@ func SetClearHistory(ctx context.Context) context.Context { // ClearHistoryFromContext returns clear history value from the context. func ClearHistoryFromContext(ctx context.Context) bool { - clear, ok := ctx.Value(clearHistoryContextKey).(bool) + clearHistory, ok := ctx.Value(clearHistoryContextKey).(bool) if ok { - return clear + return clearHistory } return false } diff --git a/option.go b/option.go index c4ecab6..8dd4451 100644 --- a/option.go +++ b/option.go @@ -90,9 +90,9 @@ func WithFlashProvider(flashData FlashProvider) Option { } // WithEncryptHistory returns Option that will enable Inertia's global history encryption. -func WithEncryptHistory(encrypt ...bool) Option { +func WithEncryptHistory(encryptHistory ...bool) Option { return func(i *Inertia) error { - i.encryptHistory = firstOr[bool](encrypt, true) + i.encryptHistory = firstOr[bool](encryptHistory, true) return nil } }