From 20f96565abe82d2c12792808f0d6bdba373e4141 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 1 Sep 2022 14:31:59 +0200 Subject: [PATCH] chore: rename WithCache to the more appropriate WithColorCache --- output.go | 4 ++-- termenv_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/output.go b/output.go index da0fc5f..5477892 100644 --- a/output.go +++ b/output.go @@ -87,9 +87,9 @@ func WithProfile(profile Profile) func(*Output) { } } -// WithCache returns a new Output with fore- and background color values +// WithColorCache returns a new Output with fore- and background color values // pre-fetched and cached. -func WithCache(v bool) func(*Output) { +func WithColorCache(v bool) func(*Output) { return func(o *Output) { o.cache = v diff --git a/termenv_test.go b/termenv_test.go index f578d60..8b59d98 100644 --- a/termenv_test.go +++ b/termenv_test.go @@ -386,7 +386,7 @@ func TestPseudoTerm(t *testing.T) { } func TestCache(t *testing.T) { - o := NewOutput(os.Stdout, WithCache(true), WithProfile(TrueColor)) + o := NewOutput(os.Stdout, WithColorCache(true), WithProfile(TrueColor)) if o.cache != true { t.Errorf("Expected cache to be active, got %t", o.cache)