-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[patch] feature add Len function that returns object conunts #35
Conversation
@@ -358,9 +362,18 @@ func Foreach(ctx context.Context, f func(string, interface{}, int64) bool) Gache | |||
return instance.Foreach(ctx, f) | |||
} | |||
|
|||
func Len() int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function Len should have comment or be unexported
Codecov Report
@@ Coverage Diff @@
## master #35 +/- ##
=========================================
- Coverage 7.48% 7.21% -0.28%
=========================================
Files 1 1
Lines 187 194 +7
=========================================
Hits 14 14
- Misses 173 180 +7
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #35 +/- ##
=========================================
- Coverage 7.48% 7.21% -0.28%
=========================================
Files 1 1
Lines 187 194 +7
=========================================
Hits 14 14
- Misses 173 180 +7
Continue to review full report at Codecov.
|
@@ -36,6 +36,7 @@ func main() { | |||
glg.Info(v3) | |||
} | |||
|
|||
glg.Debugf("Len:\t%d", gache.Len()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of glg.Debugf
is not checked (from errcheck
)
}{ | ||
// TODO: Add test cases. | ||
} | ||
for _, tt := range tests { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
range var tt copies lock: struct{name string; fields github.com/kpango/gache.fields; want int} contains github.com/kpango/gache.fields contains github.com/kpango/gache/vendor/golang.org/x/sync/singleflight.Group contains sync.Mutex (from govet
)
expChan: tt.fields.expChan, | ||
expFunc: tt.fields.expFunc, | ||
expFuncEnabled: tt.fields.expFuncEnabled, | ||
expGroup: tt.fields.expGroup, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
literal copies lock value from tt.fields.expGroup: github.com/kpango/gache/vendor/golang.org/x/sync/singleflight.Group contains sync.Mutex (from govet
)
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
7d23837
to
d150214
Compare
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
Signed-off-by: kpango i.can.feel.gravity@gmail.com