Skip to content

Commit

Permalink
doc(fix): fix cache description when there is an error
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuigo committed Dec 18, 2023
1 parent 1b88216 commit 25ebcc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ e.g.
})

### Do not cache if there is an error
> By default, gofnext will cache error when there is an error.
> By default, gofnext won't cache error when there is an error.
To use the cache even when there is an **error**, just add `NeedCacheIfErr: true`.
To use the cache even when there is an **error**, simply add `NeedCacheIfErr: true`.
Refer to: https://github.com/ahuigo/gofnext/blob/main/examples/decorator-err_test.go

gofnext.CacheFn1Err(getUserScore, &gofnext.Config{
Expand Down
4 changes: 2 additions & 2 deletions readme.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ e.g.
})

### 如果有error就不缓存
> 默认有error 不会缓存.
> 默认有函数返回error时, 就不会用缓存.
如果存在error时, 也使用缓存话。 参考: https://github.com/ahuigo/gofnext/blob/main/examples/decorator-err_test.go
如果存在error时, 也需要缓存的话。 参考: https://github.com/ahuigo/gofnext/blob/main/examples/decorator-err_test.go

gofnext.CacheFn1Err(getUserScore, &gofnext.Config{
NeedCacheIfErr: true,
Expand Down

0 comments on commit 25ebcc0

Please sign in to comment.