From 64d8c3ac4376f84e56b8c3f21c278756ad346670 Mon Sep 17 00:00:00 2001 From: mkbeh Date: Mon, 21 Sep 2026 19:40:37 +0300 Subject: [PATCH] docs: align loader example formatting --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ccfaa32..07ecda0 100644 --- a/README.md +++ b/README.md @@ -104,10 +104,12 @@ exists; successful results are cached using the cache's default expiration: ```go // Define a loader that fetches the value from an upstream source. -loader := pacecache.Loader[string, string](func(ctx context.Context, key string) (string, bool, error) { - // Fetch data from a database, file, or remote service. - return "loaded value", true, nil -}) +loader := pacecache.Loader[string, string]( + func(ctx context.Context, key string) (string, bool, error) { + // Fetch data from a database, file, or remote service. + return "loaded value", true, nil + }, +) // Return the cached value or invoke the loader on a miss. value, found, err := cache.GetOrLoadFunc(ctx, "key", loader)