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

Fix deepsource: RVV-B0011 exported function returning value of unexported type #1848

Conversation

vankichi
Copy link
Contributor

Description:

I have fixed the RVV-B0011.

Fixing the issue, required changing the test code at the internal/cache package.

I have changed the checkFunc to ensure comparing struct which satisfies the Cache interface instead of using go-cmp.
The code is like:

checkFunc := func(want, got Cache) error {
        cw := reflect.ValueOf(want.(*cache))
        cg := reflect.ValueOf(got.(*cache))
        for i := 0 ; i < reflect.Indirect(cg).NumFiled(); i++ {
                // compare
        }
        return nil
}

Related Issue:

Versions:

  • Go Version: 1.19.2
  • Docker Version: 20.10.8
  • Kubernetes Version: 1.22.0
  • NGT Version: 1.14.8

Checklist:

Special notes for your reviewer:

…xported type

Signed-off-by: vankichi <kyukawa315@gmail.com>
@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - replace the PR body by changelog details
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase main
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@vdaas-ci
Copy link
Collaborator

[WARNING:INTCFG] Changes in interal/config may require you to change Helm charts. Please check.

@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Base: 30.54% // Head: 30.52% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (6389062) compared to base (f6f55f9).
Patch coverage: 88.88% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1848      +/-   ##
==========================================
- Coverage   30.54%   30.52%   -0.03%     
==========================================
  Files         367      367              
  Lines       33833    33833              
==========================================
- Hits        10335    10328       -7     
- Misses      23086    23091       +5     
- Partials      412      414       +2     
Impacted Files Coverage Δ
internal/cache/cacher/cacher.go 100.00% <ø> (ø)
internal/net/dialer.go 78.40% <ø> (+0.99%) ⬆️
pkg/agent/sidecar/service/storage/storage.go 0.00% <0.00%> (ø)
internal/cache/cache.go 100.00% <100.00%> (ø)
internal/cache/gache/gache.go 100.00% <100.00%> (ø)
internal/config/compress.go 100.00% <100.00%> (ø)
internal/log/zap/zap.go 84.42% <100.00%> (ø)
internal/net/option.go 88.50% <100.00%> (ø)
internal/params/params.go 100.00% <100.00%> (ø)
...nt/core/ngt/service/vqueue/uninserted_index_map.go 64.51% <0.00%> (-5.92%) ⬇️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

internal/cache/gache/gache.go Outdated Show resolved Hide resolved
internal/log/zap/zap.go Outdated Show resolved Hide resolved
internal/log/zap/zap.go Outdated Show resolved Hide resolved
internal/cache/gache/gache_test.go Outdated Show resolved Hide resolved
Signed-off-by: vankichi <kyukawa315@gmail.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 21, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6389062
Status: ✅  Deploy successful!
Preview URL: https://29cc238c.vald.pages.dev
Branch Preview URL: https://refactor-rvv-b0011-exported-.vald.pages.dev

View logs

@github-actions github-actions bot added size/M and removed size/M labels Nov 21, 2022
Signed-off-by: vankichi <kyukawa315@gmail.com>
Signed-off-by: vankichi <kyukawa315@gmail.com>
Signed-off-by: vankichi <kyukawa315@gmail.com>
internal/cache/gache/gache.go Outdated Show resolved Hide resolved
internal/cache/cache.go Show resolved Hide resolved
internal/log/zap/zap.go Show resolved Hide resolved
internal/cache/gache/gache_test.go Show resolved Hide resolved
Copy link
Collaborator

@hlts2 hlts2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vankichi vankichi merged commit fc45cbb into main Nov 21, 2022
@vankichi vankichi deleted the refactor/RVV-B0011/exported-function-returning-value-of-unxported-type branch November 21, 2022 08:20
@kpango kpango mentioned this pull request Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants