From 15050df46bf978b9a432882c2b295e45197f6120 Mon Sep 17 00:00:00 2001 From: kukymbr Date: Tue, 5 Mar 2024 01:34:06 +0300 Subject: [PATCH] readme: minor change --- README.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b9cceba..46c0aac 100644 --- a/README.md +++ b/README.md @@ -112,9 +112,10 @@ scanner := filecache.NewScanner("/path/to/cache/dir") err := scanner.Scan(func(entry filecache.ScanEntry) error { // Do something with the found entry... + return nil }) if err := nil { - // Handle the error... + // Handle the error... } ``` @@ -122,7 +123,7 @@ if err := nil { The expired cache items are removed by the `GarbageCollector`, assigned to the `FileCache` instance. -There are three types of the `GarbageCollector` adapters: +There are three predefined realizations of the `GarbageCollector`: * `filecache.NewNopGarbageCollector()` — the `GarbageCollector` doing nothing, all the files are kept; * `filecache.NewProbabilityGarbageCollector()` — the `GarbageCollector` running with the defined probability, used by default; @@ -130,17 +131,6 @@ There are three types of the `GarbageCollector` adapters: See the [gc.go's](gc.go) godocs for more info. -```go -// Initialize the scanner -scanner := filecache.NewScanner(fc.GetPath()) - -// Iterate -err = scanner.Scan(func(entry filecache.ScanEntry) error { - // Do some nice things... - return nil -}) -``` - ## License [MIT](/LICENSE). \ No newline at end of file