fix: ExampleGetContentsWithCache intlog

This commit is contained in:
hailaz
2021-11-09 16:34:00 +08:00
parent 58dd8a29db
commit 33694c8b47

View File

@ -4,10 +4,12 @@ import (
"fmt"
"time"
"github.com/gogf/gf/v2/internal/intlog"
"github.com/gogf/gf/v2/os/gfile"
)
func ExampleGetContentsWithCache() {
intlog.SetEnabled(false)
// init
fileName := "123.txt"
tempDir := gfile.TempDir("gfile_example_cache")
@ -32,6 +34,8 @@ func ExampleGetContentsWithCache() {
// write new contents will clear its cache
gfile.PutContents(tempFile, "new test contents")
time.Sleep(time.Second * 1)
// read contents
content2 := gfile.GetContentsWithCache(tempFile)
fmt.Println(content2)