gogf / gf

@@ -8,7 +8,6 @@
Loading
8 8
9 9
import (
10 10
	"context"
11 -
	"time"
12 11
13 12
	"github.com/gogf/gf/v2/container/glist"
14 13
	"github.com/gogf/gf/v2/container/gmap"
@@ -35,7 +34,6 @@
Loading
35 34
		rawList: glist.New(true),
36 35
		closed:  gtype.NewBool(),
37 36
	}
38 -
	gtimer.AddSingleton(context.Background(), time.Second, lru.SyncAndClear)
39 37
	return lru
40 38
}
41 39

@@ -50,34 +50,35 @@
Loading
50 50
	if src == dst {
51 51
		return nil
52 52
	}
53 -
	in, err := Open(src)
53 +
	var inFile *os.File
54 +
	inFile, err = Open(src)
54 55
	if err != nil {
55 56
		return
56 57
	}
57 58
	defer func() {
58 -
		if e := in.Close(); e != nil {
59 +
		if e := inFile.Close(); e != nil {
59 60
			err = gerror.Wrapf(e, `file close failed for "%s"`, src)
60 61
		}
61 62
	}()
62 -
	out, err := Create(dst)
63 +
	var outFile *os.File
64 +
	outFile, err = Create(dst)
63 65
	if err != nil {
64 66
		return
65 67
	}
66 68
	defer func() {
67 -
		if e := out.Close(); e != nil {
69 +
		if e := outFile.Close(); e != nil {
68 70
			err = gerror.Wrapf(e, `file close failed for "%s"`, dst)
69 71
		}
70 72
	}()
71 -
	if _, err = io.Copy(out, in); err != nil {
73 +
	if _, err = io.Copy(outFile, inFile); err != nil {
72 74
		err = gerror.Wrapf(err, `io.Copy failed from "%s" to "%s"`, src, dst)
73 75
		return
74 76
	}
75 -
	if err = out.Sync(); err != nil {
77 +
	if err = outFile.Sync(); err != nil {
76 78
		err = gerror.Wrapf(err, `file sync failed for file "%s"`, dst)
77 79
		return
78 80
	}
79 -
	err = Chmod(dst, DefaultPermCopy)
80 -
	if err != nil {
81 +
	if err = Chmod(dst, DefaultPermCopy); err != nil {
81 82
		return
82 83
	}
83 84
	return

@@ -427,14 +427,17 @@
Loading
427 427
		}
428 428
	}
429 429
	// Processing expired keys from LRU.
430 -
	if c.cap > 0 && c.lruGetList.Len() > 0 {
431 -
		for {
432 -
			if v := c.lruGetList.PopFront(); v != nil {
433 -
				c.lru.Push(v)
434 -
			} else {
435 -
				break
430 +
	if c.cap > 0 {
431 +
		if c.lruGetList.Len() > 0 {
432 +
			for {
433 +
				if v := c.lruGetList.PopFront(); v != nil {
434 +
					c.lru.Push(v)
435 +
				} else {
436 +
					break
437 +
				}
436 438
			}
437 439
		}
440 +
		c.lru.SyncAndClear(ctx)
438 441
	}
439 442
	// ========================
440 443
	// Data Cleaning up.
Files Coverage
container 95.54%
contrib 67.19%
crypto 80.86%
database 70.95%
debug/gdebug 81.52%
encoding 81.49%
errors 91.65%
frame 61.10%
i18n/gi18n 79.72%
internal 81.93%
net 65.10%
os 72.87%
test/gtest 70.36%
text 89.54%
util 88.03%
Project Totals (589 files) 78.89%
3554338035
go-1.17-386
3554338035
go-1.17-amd64
3554338035
go-1.15-386
3554338035
go-1.15-amd64
3554338035
go-1.16-386
3554338035
go-1.16-amd64
3554338035
go-1.18-386
3554338035
go-1.18-amd64

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading