Skip to content
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

Merged
merged 2 commits into from
Mar 7, 2019

Conversation

kpango
Copy link
Owner

@kpango kpango commented Mar 7, 2019

Signed-off-by: kpango i.can.feel.gravity@gmail.com

@@ -358,9 +362,18 @@ func Foreach(ctx context.Context, f func(string, interface{}, int64) bool) Gache
return instance.Foreach(ctx, f)
}

func Len() int {
Copy link

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
Copy link

codecov bot commented Mar 7, 2019

Codecov Report

Merging #35 into master will decrease coverage by 0.27%.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
gache.go 7.21% <0%> (-0.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fa7218...7d23837. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 7, 2019

Codecov Report

Merging #35 into master will decrease coverage by 0.27%.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
gache.go 7.21% <0%> (-0.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fa7218...0c9b95b. Read the comment docs.

@@ -36,6 +36,7 @@ func main() {
glg.Info(v3)
}

glg.Debugf("Len:\t%d", gache.Len())

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 {

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,

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>
@kpango kpango force-pushed the feature-add-cache-object-length branch from 7d23837 to d150214 Compare March 7, 2019 05:14
@kpango kpango merged commit c6d0b57 into master Mar 7, 2019
@kpango kpango deleted the feature-add-cache-object-length branch March 7, 2019 05:19
kpango pushed a commit that referenced this pull request Mar 11, 2019
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants