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

Vald V1 New Design APIs #826

Merged
merged 87 commits into from
Jan 12, 2021
Merged

Vald V1 New Design APIs #826

merged 87 commits into from
Jan 12, 2021

Conversation

kpango
Copy link
Collaborator

@kpango kpango commented Nov 10, 2020

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

Description:

This PR include Vald's new design APIs

  • proto file
  • Makefile / Makefile.d/*
  • generated code such as grpc, swagger, api documents

This change includes a lot of features.
I'll make sub PRs (I'll add links below) for this branch please review each PRs.

Related Issue:

How Has This Been Tested?:

Environment:

  • Go Version: 1.15.4
  • Docker Version: 20.10.0-beta1
  • Kubernetes Version: 1.18.9
  • NGT Version: 1.12.2

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - add changelog comment
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase master

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

LanguageTool

charts/vald/README.md|92 col 61| This sentence does not start with an uppercase letter (UPPERCASE_SENTENCE_START)
Suggestions: It
Rule: https://community.languagetool.org/rule/show/UPPERCASE_SENTENCE_START?lang=en-US
Category: CASING
charts/vald/README.md|92 col 168| This sentence does not start with an uppercase letter (UPPERCASE_SENTENCE_START)
Suggestions: For
Rule: https://community.languagetool.org/rule/show/UPPERCASE_SENTENCE_START?lang=en-US
Category: CASING

apis/docs/v1/docs.md Show resolved Hide resolved
apis/docs/v1/docs.md Show resolved Hide resolved
apis/docs/v1/docs.md Show resolved Hide resolved
apis/docs/v1/docs.md Show resolved Hide resolved
apis/docs/v1/docs.md Show resolved Hide resolved
apis/docs/v1/docs.md Show resolved Hide resolved
apis/docs/v1/docs.md Show resolved Hide resolved
apis/docs/v1/docs.md Show resolved Hide resolved
apis/docs/v1/docs.md Show resolved Hide resolved
apis/docs/v1/docs.md Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

internal/db/nosql/cassandra/option.go|50 col 23| mnd: Magic number: 1000, in detected (gomnd)
internal/db/nosql/cassandra/option.go|51 col 24| mnd: Magic number: 1000, in detected (gomnd)
internal/db/nosql/cassandra/option.go|54 col 15| mnd: Magic number: 2, in detected (gomnd)
internal/db/nosql/cassandra/option.go|55 col 15| mnd: Magic number: 5000, in detected (gomnd)
internal/db/nosql/cassandra/option.go|56 col 11| mnd: Magic number: 9042, in detected (gomnd)
internal/db/nosql/cassandra/cassandra_test.go|83 col 32| copylocks: func passes lock by value: crypto/tls.Config contains sync.RWMutex (govet)
internal/db/nosql/cassandra/cassandra_test.go|84 col 28| copylocks: call of reflect.DeepEqual copies lock value: crypto/tls.Config contains sync.RWMutex (govet)
internal/observability/collector/collector_option.go|32 col 5| collectorDefaultOpts is a global variable (gochecknoglobals)
internal/k8s/metrics/node/option.go|24 col 5| defaultOpts is unused (deadcode)
internal/cache/cache_test.go|29 col 5| goleakIgnoreOptions is a global variable (gochecknoglobals)
pkg/agent/core/ngt/handler/grpc/handler.go|291| 291-314 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:349-374 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|349| 349-374 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:291-314 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|186| 186-220 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:222-256 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|222| 222-256 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:186-220 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|210| line is 173 characters (lll)
pkg/agent/core/ngt/handler/grpc/handler.go|246| line is 177 characters (lll)
pkg/agent/core/ngt/handler/grpc/handler.go|409| line is 129 characters (lll)
pkg/agent/core/ngt/handler/grpc/handler.go|500| line is 129 characters (lll)
pkg/agent/core/ngt/handler/grpc/option_test.go|150 col 3| name is unused (structcheck)
pkg/agent/core/ngt/handler/grpc/option_test.go|33 col 3| ip is unused (structcheck)
pkg/agent/core/ngt/handler/grpc/option_test.go|501 col 3| eg is unused (structcheck)
pkg/agent/core/ngt/handler/grpc/handler.go|201 col 3| only cuddled expressions if assigning variable or using from line above (wsl)
pkg/agent/core/ngt/handler/grpc/handler.go|218 col 2| expressions should not be cuddled with blocks (wsl)
pkg/agent/core/ngt/handler/grpc/handler.go|237 col 3| only cuddled expressions if assigning variable or using from line above (wsl)
pkg/agent/core/ngt/handler/grpc/handler.go|254 col 2| expressions should not be cuddled with blocks (wsl)
pkg/agent/core/ngt/handler/grpc/option.go|40 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/agent/core/ngt/service/option.go|37 col 22| mnd: Magic number: 100, in detected (gomnd)
pkg/agent/core/ngt/service/vcaches_test.go|179 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|180 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|360 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|361 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|702 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|703 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
internal/net/grpc/option.go|38 col 25| mnd: Magic number: 3, in detected (gomnd)
internal/net/grpc/client_test.go|205 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|206 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|342 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|343 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|482 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|483 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|178 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|179 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|355 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|356 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|693 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|694 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/db/rdb/mysql/dbr/connection_test.go|17 col 9| package should be dbr_test instead of dbr (testpackage)
internal/db/rdb/mysql/dbr/dbr_mock_test.go|17 col 9| package should be dbr_test instead of dbr (testpackage)
internal/db/rdb/mysql/dbr/dbr_test.go|17 col 9| package should be dbr_test instead of dbr (testpackage)
internal/net/grpc/metric/client_option.go|22 col 5| clientDefaultOpts is a global variable (gochecknoglobals)
internal/net/grpc/metric/server_option.go|22 col 5| serverDefaultOpts is a global variable (gochecknoglobals)
pkg/manager/index/service/option.go|35 col 21| mnd: Magic number: 100, in detected (gomnd)
pkg/manager/index/service/option.go|36 col 23| mnd: Magic number: 10000, in detected (gomnd)
pkg/manager/index/service/indexer_test.go|204 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|205 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|333 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|334 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|459 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|460 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|177 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|178 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|354 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|355 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|692 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|693 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
internal/net/net.go|59 col 5| DefaultResolver is a global variable (gochecknoglobals)
internal/net/net_test.go|39 col 5| goleakIgnoreOptions is a global variable (gochecknoglobals)
pkg/gateway/backup/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
internal/net/tcp/option.go|31 col 5| defaultDialerOptions is a global variable (gochecknoglobals)
pkg/agent/sidecar/service/observer/observer.go|500 col 17| G304: Potential file inclusion via variable (gosec)
pkg/gateway/vald/service/backup_option.go|24 col 5| defaultBackupOpts is a global variable (gochecknoglobals)
pkg/gateway/vald/service/filter_option.go|24 col 5| defaultFilterOpts is a global variable (gochecknoglobals)
pkg/gateway/vald/service/gateway_option.go|27 col 5| defaultGWOpts is a global variable (gochecknoglobals)
pkg/gateway/vald/service/meta_option.go|30 col 5| defaultMetaOpts is a global variable (gochecknoglobals)
internal/net/http/transport/roundtrip_mock_test.go|36| line is 122 characters (lll)
internal/net/http/transport/roundtrip.go|55 col 24| response body must be closed (bodyclose)
internal/errors/errors.go|124 col 24| err113: do not compare errors directly, use errors.Is() instead: "err == target" (goerr113)
internal/compress/zstd_option.go|29 col 27| mnd: Magic number: 3, in detected (gomnd)
internal/client/v1/client/vald/option.go|24 col 5| defaultOpts is unused (deadcode)
internal/client/v1/client/vald/vald.go|43| line is 130 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|250 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/cassandra/handler/grpc/handler.go|258 col 79| toModelVector - result err is always nil (unparam)
hack/helm/schema/gen/main.go|102 col 12| G304: Potential file inclusion via variable (gosec)
pkg/manager/backup/mysql/handler/grpc/handler.go|241 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/mysql/handler/grpc/handler.go|249 col 79| toModelVector - result err is always nil (unparam)
internal/k8s/node/option.go|24 col 5| defaultOpts is unused (deadcode)
pkg/gateway/lb/handler/grpc/handler.go|336| 336-370 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:372-406 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|372| 372-406 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:336-370 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|181| Function 'search' is too long (124 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|408| Function 'Insert' is too long (69 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|715| Function 'MultiUpsert' is too long (95 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|291 col 20| appendAssign: append result not assigned to the same slice (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|759 col 6| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|779 col 6| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|457 col 7| err113: do not compare errors directly, use errors.Is() instead: "err == errors.ErrRPCCallFailed(target, context.Canceled)" (goerr113)
pkg/gateway/lb/handler/grpc/option.go|33 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/lb/handler/grpc/option.go|57 col 22| mnd: Magic number: 10, in detected (gomnd)
pkg/gateway/lb/handler/grpc/handler.go|282 col 7| break with no blank line before (nlreturn)
pkg/gateway/meta/handler/grpc/handler.go|196| 196-230 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:232-266 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|232| 232-266 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:196-230 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|268| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|349| Function 'MultiInsert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|550| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|593 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|611 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|285 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/handler.go|366 col 3| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
internal/backoff/backoff.go|67| Function 'Do' is too long (65 > 60) (funlen)
internal/backoff/option.go|33 col 20| mnd: Magic number: 1.5, in detected (gomnd)
internal/backoff/option.go|34 col 17| mnd: Magic number: 50, in detected (gomnd)
pkg/agent/sidecar/service/restorer/restorer.go|122 col 40| (*restorer).startRestore$1 - result 0 (interface{}) is always nil (unparam)
internal/db/storage/blob/s3/reader/option.go|31 col 32| mnd: Magic number: 1024, in detected (gomnd)
internal/net/grpc/pool/option.go|29 col 16| mnd: Magic number: 80, in detected (gomnd)
internal/net/grpc/pool/option.go|30 col 14| mnd: Magic number: 65535, in detected (gomnd)
pkg/gateway/meta/service/meta.go|400| 400-430 lines are duplicate of pkg/gateway/meta/service/meta.go:462-492 (dupl)
pkg/gateway/meta/service/meta.go|462| 462-492 lines are duplicate of pkg/gateway/meta/service/meta.go:400-430 (dupl)
pkg/gateway/meta/service/meta.go|136| 136-219 lines are duplicate of pkg/gateway/meta/service/meta.go:221-304 (dupl)
pkg/gateway/meta/service/meta.go|221| 221-304 lines are duplicate of pkg/gateway/meta/service/meta.go:136-219 (dupl)
pkg/gateway/backup/usecase/vald.go|48| Function 'New' is too long (101 > 60) (funlen)
pkg/gateway/backup/usecase/vald.go|160 col 26| mnd: Magic number: 6, in detected (gomnd)
pkg/manager/compressor/service/registerer.go|64 col 51| S1019: should use make(map[string]*payload.Backup_Vector) instead (gosimple)
internal/client/v1/client/agent/core/option.go|23 col 5| defaultOptions is unused (deadcode)
internal/io/ioutil/ioutil.go|32 col 15| Error return value of f.Close is not checked (errcheck)
pkg/gateway/lb/usecase/vald.go|47| Function 'New' is too long (105 > 60) (funlen)
pkg/manager/backup/cassandra/service/cassandra.go|74 col 28| (*client).getVector - ctx is unused (unparam)
pkg/gateway/backup/handler/grpc/handler.go|433 col 5| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|517 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|535 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|585 col 6| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|649 col 7| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|170 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
internal/db/rdb/mysql/mysql.go|40 col 2| vectorColumnName is unused (deadcode)
internal/config/redis_test.go|207 col 14| struct of size 352 bytes could be of size 344 bytes (maligned)

pkg/manager/replication/agent/router/option.go Outdated Show resolved Hide resolved
hack/license/gen/main.go Show resolved Hide resolved
hack/license/gen/main.go Show resolved Hide resolved
internal/db/nosql/cassandra/cassandra_test.go Show resolved Hide resolved
internal/db/nosql/cassandra/option_test.go Show resolved Hide resolved
internal/db/nosql/cassandra/cassandra_mock.go Outdated Show resolved Hide resolved
internal/db/nosql/cassandra/observer.go Show resolved Hide resolved
internal/db/nosql/cassandra/observer.go Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 10, 2020

Codecov Report

Merging #826 (4d5bb4b) into master (c4df6ef) will decrease coverage by 2.97%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #826      +/-   ##
==========================================
- Coverage   19.19%   16.22%   -2.98%     
==========================================
  Files         422      472      +50     
  Lines       19548    23113    +3565     
==========================================
- Hits         3752     3749       -3     
- Misses      15586    19130    +3544     
- Partials      210      234      +24     
Impacted Files Coverage Δ
cmd/agent/core/ngt/main.go 0.00% <ø> (ø)
cmd/agent/sidecar/main.go 0.00% <ø> (ø)
cmd/discoverer/k8s/main.go 0.00% <ø> (ø)
cmd/gateway/backup/main.go 0.00% <ø> (ø)
cmd/gateway/lb/main.go 0.00% <ø> (ø)
cmd/gateway/meta/main.go 0.00% <ø> (ø)
cmd/gateway/vald/main.go 0.00% <ø> (ø)
cmd/manager/backup/cassandra/main.go 0.00% <ø> (ø)
cmd/manager/backup/mysql/main.go 0.00% <ø> (ø)
cmd/manager/compressor/main.go 0.00% <ø> (ø)
... and 329 more

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 8d7999d...4d5bb4b. Read the comment docs.

fix
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

pkg/gateway/lb/handler/grpc/handler.go|715| Function 'MultiUpsert' is too long (95 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|291 col 20| appendAssign: append result not assigned to the same slice (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|759 col 6| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|779 col 6| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|100| line is 134 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|155| line is 125 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|210| line is 125 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|360| line is 173 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|396| line is 177 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|445| line is 137 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|474| line is 131 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|494| line is 130 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|526| line is 137 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|588| line is 133 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|607| line is 129 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|645| line is 142 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|838| line is 128 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|883| line is 130 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|115 col 3| if statements should only be cuddled with assignments used in the if statement itself (wsl)
pkg/gateway/lb/handler/grpc/handler.go|457 col 7| err113: do not compare errors directly, use errors.Is() instead: "err == errors.ErrRPCCallFailed(target, context.Canceled)" (goerr113)
pkg/gateway/lb/handler/grpc/handler.go|194 col 67| mnd: Magic number: 2, in detected (gomnd)
pkg/gateway/lb/handler/grpc/option.go|32 col 23| mnd: Magic number: 3, in detected (gomnd)
pkg/gateway/lb/handler/grpc/option.go|33 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/lb/handler/grpc/option.go|57 col 22| mnd: Magic number: 10, in detected (gomnd)
pkg/gateway/lb/handler/grpc/handler.go|282 col 7| break with no blank line before (nlreturn)
pkg/manager/backup/cassandra/handler/grpc/handler.go|50| line is 139 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|122| line is 141 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|153| line is 160 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|164| line is 121 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|204| line is 127 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|250 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/cassandra/handler/grpc/handler.go|258 col 79| toModelVector - result err is always nil (unparam)
pkg/tools/cli/loadtest/service/loader_option.go|30 col 18| mnd: Magic number: 100, in detected (gomnd)
pkg/gateway/backup/handler/grpc/handler.go|154| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|240| Function 'MultiInsert' has too many statements (42 > 40) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|474| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|433 col 5| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|517 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|535 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|585 col 6| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|649 col 7| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|170 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/backup/handler/grpc/handler.go|248 col 3| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/backup/handler/grpc/handler.go|575 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/backup/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/lb/usecase/vald.go|48| Function 'New' is too long (109 > 60) (funlen)
pkg/gateway/lb/usecase/vald.go|113| pkg/gateway/lb/usecase/vald.go:113: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/lb/usecase/vald.go|145| pkg/gateway/lb/usecase/vald.go:145: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/lb/usecase/vald.go|168 col 26| mnd: Magic number: 6, in detected (gomnd)
internal/net/grpc/pool/pool.go|151| internal/net/grpc/pool/pool.go:151: Line contains TODO/BUG/FIXME: "TODO maybe we should check neighbour poo..." (godox)
internal/net/grpc/pool/option.go|29 col 16| mnd: Magic number: 80, in detected (gomnd)
internal/net/grpc/pool/option.go|30 col 14| mnd: Magic number: 65535, in detected (gomnd)
pkg/gateway/vald/handler/grpc/handler.go|303| Function 'Insert' has too many statements (51 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|410| Function 'MultiInsert' has too many statements (54 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|512| Function 'Update' is too long (68 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|687| Function 'MultiUpsert' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|831| Function 'MultiRemove' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/option.go|33 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/discoverer/k8s/service/nodemap.go|214| 214-247 lines are duplicate of pkg/discoverer/k8s/service/nodemetricsmap.go:214-247 (dupl)
pkg/discoverer/k8s/service/nodemap.go|85 col 5| expungedNodeMap is a global variable (gochecknoglobals)
pkg/discoverer/k8s/service/discover.go|147 col 28| G601: Implicit memory aliasing in for loop. (gosec)
pkg/agent/sidecar/service/restorer/restorer.go|122 col 40| (*restorer).startRestore$1 - result 0 (interface{}) is always nil (unparam)
pkg/manager/index/service/option.go|36 col 23| mnd: Magic number: 10000, in detected (gomnd)
internal/db/kvs/redis/redis.go|130| Function 'newClient' is too long (61 > 60) (funlen)
internal/db/kvs/redis/redis.go|194| Function 'newClusterClient' is too long (69 > 60) (funlen)
pkg/agent/core/ngt/handler/grpc/handler.go|291| 291-314 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:349-374 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|349| 349-374 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:291-314 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|186| 186-220 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:222-256 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|222| 222-256 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:186-220 (dupl)
internal/k8s/pod/pod.go|68| Function 'Reconcile' is too long (78 > 60) (funlen)
pkg/manager/backup/cassandra/service/cassandra.go|74 col 28| (*client).getVector - ctx is unused (unparam)
pkg/gateway/backup/usecase/vald.go|105| pkg/gateway/backup/usecase/vald.go:105: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/backup/usecase/vald.go|137| pkg/gateway/backup/usecase/vald.go:137: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/meta/handler/grpc/handler.go|196| 196-230 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:232-266 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|232| 232-266 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:196-230 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|593 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|611 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
internal/errors/errors.go|124 col 24| err113: do not compare errors directly, use errors.Is() instead: "err == target" (goerr113)
pkg/gateway/meta/service/meta.go|400| 400-430 lines are duplicate of pkg/gateway/meta/service/meta.go:462-492 (dupl)
pkg/gateway/meta/service/meta.go|462| 462-492 lines are duplicate of pkg/gateway/meta/service/meta.go:400-430 (dupl)
pkg/gateway/meta/service/meta.go|136| 136-219 lines are duplicate of pkg/gateway/meta/service/meta.go:221-304 (dupl)
pkg/gateway/meta/service/meta.go|221| 221-304 lines are duplicate of pkg/gateway/meta/service/meta.go:136-219 (dupl)
internal/net/grpc/client.go|164 col 16| Error return value of g.Close is not checked (errcheck)
internal/net/grpc/client.go|495 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
internal/net/grpc/client.go|333 col 25| Using the variable on range scope addr in function literal (scopelint)
internal/net/grpc/client.go|364| unnecessary trailing newline (whitespace)
pkg/gateway/meta/usecase/vald.go|113| pkg/gateway/meta/usecase/vald.go:113: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/meta/usecase/vald.go|145| pkg/gateway/meta/usecase/vald.go:145: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
internal/net/http/transport/roundtrip.go|55 col 24| response body must be closed (bodyclose)
internal/config/redis_test.go|219 col 14| struct of size 384 bytes could be of size 376 bytes (maligned)

opt(s)
}
return s
}

func (s *server) GetVector(ctx context.Context, req *payload.Backup_GetVector_Request) (res *payload.Backup_Compressed_MetaVector, err error) {
func (s *server) GetVector(ctx context.Context, req *payload.Backup_GetVector_Request) (res *payload.Backup_Compressed_Vector, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
line is 139 characters (lll)

@@ -96,63 +96,63 @@ func (s *server) Locations(ctx context.Context, req *payload.Backup_Locations_Re
}, nil
}

func (s *server) Register(ctx context.Context, meta *payload.Backup_Compressed_MetaVector) (res *payload.Empty, err error) {
func (s *server) Register(ctx context.Context, vector *payload.Backup_Compressed_Vector) (res *payload.Empty, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
line is 122 characters (lll)

if err != nil {
log.Errorf("[Register]\tunknown error\t%+v", err)
if span != nil {
span.SetStatus(trace.StatusCodeInternal(err.Error()))
}
return nil, status.WrapWithInternal(fmt.Sprintf("Register API uuid %s's could not convert vector to meta_vector", uuid), err, info.Get())
return nil, status.WrapWithInternal(fmt.Sprintf("Register API uuid %s's could not convert vector to backup format", uuid), err, info.Get())
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
line is 141 characters (lll)

if err != nil {
log.Errorf("[Register]\tunknown error\t%+v", err)
if span != nil {
span.SetStatus(trace.StatusCodeInternal(err.Error()))
}
return nil, status.WrapWithInternal(fmt.Sprintf("Register API uuid %s's failed to backup metadata", uuid), err, info.Get())
return nil, status.WrapWithInternal(fmt.Sprintf("Register API uuid %s's failed to backup vector", uuid), err, info.Get())
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
line is 123 characters (lll)

}

return new(payload.Empty), nil
}

func (s *server) RegisterMulti(ctx context.Context, metas *payload.Backup_Compressed_MetaVectors) (res *payload.Empty, err error) {
func (s *server) RegisterMulti(ctx context.Context, vectors *payload.Backup_Compressed_Vectors) (res *payload.Empty, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
line is 129 characters (lll)

@@ -682,8 +699,10 @@ func Test_vcaches_Delete(t *testing.T) {
*/
}

for _, test := range tests {
for _, tc := range tests {
test := tc
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)

})
}

func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequest) (res *payload.Search_Responses, errs error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
336-370 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:372-406 (dupl)

return res, errs
}

func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_MultiIDRequest) (res *payload.Search_Responses, errs error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
372-406 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:336-370 (dupl)

return res, nil
}

func (s *server) search(ctx context.Context, cfg *payload.Search_Config,
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
Function 'search' is too long (124 > 60) (funlen)

return res, errs
}

func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (ce *payload.Object_Location, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
Function 'Insert' is too long (69 > 60) (funlen)

Signed-off-by: kpango <kpango@vdaas.org>
…r helm/schema/gen/main.go

Signed-off-by: kpango <kpango@vdaas.org>
Signed-off-by: kpango <kpango@vdaas.org>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

pkg/gateway/lb/service/option_test.go|18 col 9| package should be service_test instead of service (testpackage)
internal/runner/option_test.go|30 col 5| goleakIgnoreOptions is a global variable (gochecknoglobals)
internal/io/ioutil/ioutil_test.go|18 col 9| package should be ioutil_test instead of ioutil (testpackage)
internal/log/logger/iface.go|19 col 6| exported type Logger should have comment or be unexported (golint)
internal/log/logger/iface.go|17 col 1| ST1000: at least one file in a package should have a package comment (stylecheck)
internal/servers/servers.go|48 col 2| ranges should only be cuddled with assignments used in the iteration (wsl)
internal/timeutil/time_test.go|28 col 5| goleakIgnoreOptions is a global variable (gochecknoglobals)
pkg/gateway/internal/location/location.go|31 col 3| append only allowed to cuddle with appended value (wsl)
pkg/gateway/internal/location/location.go|25 col 2| only one cuddle assignment allowed before range statement (wsl)
pkg/gateway/internal/location/location.go|41 col 3| append only allowed to cuddle with appended value (wsl)
pkg/gateway/internal/location/location.go|36 col 2| only one cuddle assignment allowed before range statement (wsl)
pkg/gateway/internal/location/location_test.go|16 col 9| package should be location_test instead of location (testpackage)
internal/db/kvs/redis/redis.go|130| Function 'newClient' is too long (61 > 60) (funlen)
internal/db/kvs/redis/redis.go|194| Function 'newClusterClient' is too long (69 > 60) (funlen)
internal/db/kvs/redis/option_test.go|2547 col 3| limiter is unused (structcheck)
internal/db/kvs/redis/option_test.go|2430 col 3| name is unused (structcheck)
internal/db/kvs/redis/option_test.go|2313 col 3| network is unused (structcheck)
internal/db/kvs/redis/option_test.go|2664 col 3| name is unused (structcheck)
internal/db/kvs/redis/option_test.go|2781 col 3| password is unused (structcheck)
internal/net/grpc/client.go|164 col 16| Error return value of g.Close is not checked (errcheck)
internal/net/grpc/client.go|486| Function 'Connect' is too long (70 > 60) (funlen)
internal/net/grpc/client.go|495 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
internal/net/grpc/client.go|344| line is 135 characters (lll)
internal/net/grpc/client.go|333 col 25| Using the variable on range scope addr in function literal (scopelint)
internal/net/grpc/option_test.go|504 col 3| flg is unused (structcheck)
internal/net/grpc/option_test.go|36 col 3| addrs is unused (structcheck)
internal/net/grpc/option_test.go|1206 col 3| j is unused (structcheck)
internal/net/grpc/option_test.go|270 col 3| dur is unused (structcheck)
internal/net/grpc/option_test.go|972 col 3| dur is unused (structcheck)
internal/net/grpc/option_test.go|738 col 3| opts is unused (structcheck)
internal/net/grpc/option_test.go|1089 col 3| m is unused (structcheck)
internal/net/grpc/client.go|364| unnecessary trailing newline (whitespace)
internal/net/grpc/addrs.go|79 col 2| expressions should not be cuddled with blocks (wsl)
internal/net/grpc/addrs.go|81 col 2| only one cuddle assignment allowed before range statement (wsl)
internal/net/grpc/addrs.go|114 col 3| expressions should not be cuddled with blocks (wsl)
internal/net/grpc/client.go|239 col 2| defer statements should only be cuddled with expressions on same variable (wsl)
internal/net/grpc/client.go|323 col 5| branch statements should not be cuddled if block has more than two lines (wsl)
internal/net/grpc/client.go|326 col 4| only one cuddle assignment allowed before defer statement (wsl)
internal/net/grpc/client.go|359 col 3| only cuddled expressions if assigning variable or using from line above (wsl)
internal/net/grpc/option.go|39 col 25| mnd: Magic number: 3, in detected (gomnd)
internal/net/grpc/addrs_test.go|169 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|170 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|186 col 17| copylocks: literal copies lock value from test.fields.mu: sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|267 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|268 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|284 col 17| copylocks: literal copies lock value from test.fields.mu: sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|365 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|366 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|382 col 17| copylocks: literal copies lock value from test.fields.mu: sync.RWMutex (govet)
internal/net/grpc/client_test.go|224 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|225 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|256 col 26| copylocks: literal copies lock value from test.fields.crl: sync.Map contains sync.Mutex (govet)
internal/net/grpc/client_test.go|381 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|382 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|413 col 26| copylocks: literal copies lock value from test.fields.crl: sync.Map contains sync.Mutex (govet)
internal/net/grpc/client_test.go|541 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|542 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|573 col 26| copylocks: literal copies lock value from test.fields.crl: sync.Map contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|178 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|179 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|355 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|356 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|693 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|694 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
pkg/gateway/backup/handler/grpc/handler.go|154| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|240| Function 'MultiInsert' has too many statements (42 > 40) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|474| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|433 col 5| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|517 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|535 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|585 col 6| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|649 col 7| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|74| line is 133 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|133| line is 130 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|143| line is 136 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|185| line is 121 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|197| line is 131 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|277| line is 127 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|311| line is 121 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|336| line is 133 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|352| line is 123 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|371| line is 129 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|601| line is 127 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|609| line is 127 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|628| line is 130 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|663| line is 126 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|670| line is 125 characters (lll)
pkg/gateway/backup/handler/grpc/handler.go|170 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/backup/handler/grpc/handler.go|248 col 3| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/backup/handler/grpc/handler.go|575 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/backup/handler/grpc/option_test.go|268 col 3| eg is unused (structcheck)
pkg/gateway/backup/handler/grpc/option_test.go|151 col 3| g is unused (structcheck)
pkg/gateway/backup/handler/grpc/option_test.go|385 col 3| c is unused (structcheck)
pkg/gateway/backup/handler/grpc/option_test.go|34 col 3| c is unused (structcheck)
pkg/gateway/backup/handler/grpc/handler.go|165 col 3| if statements should only be cuddled with assignments used in the if statement itself (wsl)
pkg/gateway/backup/handler/grpc/handler.go|182 col 4| if statements should only be cuddled with assignments used in the if statement itself (wsl)
pkg/gateway/backup/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
internal/singleflight/singleflight.go|51| line is 125 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|50| line is 139 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|108| line is 122 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|122| line is 141 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|131| line is 123 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|137| line is 129 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|153| line is 160 characters (lll)
pkg/manager/backup/cassandra/handler/grpc/handler.go|250 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/cassandra/handler/grpc/handler.go|258 col 79| toModelVector - result err is always nil (unparam)
internal/net/http/transport/roundtrip_mock_test.go|36| line is 122 characters (lll)
internal/net/http/transport/roundtrip.go|55 col 24| response body must be closed (bodyclose)
pkg/gateway/meta/handler/grpc/handler.go|196| 196-230 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:232-266 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|232| 232-266 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:196-230 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|268| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|349| Function 'MultiInsert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|550| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|593 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|611 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/manager/compressor/service/registerer_test.go|191 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|192 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|213 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|309 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|310 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|331 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|423 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|424 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|445 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
internal/rand/rand.go|31 col 5| pool is a global variable (gochecknoglobals)
pkg/agent/core/ngt/service/kvs/ou_test.go|176 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|177 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|353 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|354 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|691 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|692 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/discoverer/k8s/service/nodemap.go|214| 214-247 lines are duplicate of pkg/discoverer/k8s/service/nodemetricsmap.go:214-247 (dupl)
pkg/discoverer/k8s/service/nodemap.go|85 col 5| expungedNodeMap is a global variable (gochecknoglobals)
pkg/discoverer/k8s/service/discover.go|147 col 28| G601: Implicit memory aliasing in for loop. (gosec)
pkg/discoverer/k8s/service/discover_test.go|214 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|215 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
internal/net/net.go|59 col 5| DefaultResolver is a global variable (gochecknoglobals)
pkg/gateway/meta/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
pkg/manager/backup/mysql/handler/grpc/handler.go|241 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/mysql/handler/grpc/handler.go|249 col 79| toModelVector - result err is always nil (unparam)
pkg/gateway/backup/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|303| Function 'Insert' has too many statements (51 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|410| Function 'MultiInsert' has too many statements (54 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|512| Function 'Update' is too long (68 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|687| Function 'MultiUpsert' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|831| Function 'MultiRemove' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/option.go|33 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/lb/usecase/vald.go|48| Function 'New' is too long (109 > 60) (funlen)
pkg/gateway/lb/usecase/vald.go|113| pkg/gateway/lb/usecase/vald.go:113: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/lb/usecase/vald.go|145| pkg/gateway/lb/usecase/vald.go:145: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/lb/usecase/vald.go|168 col 26| mnd: Magic number: 6, in detected (gomnd)
pkg/gateway/lb/handler/grpc/handler.go|336| 336-370 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:372-406 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|372| 372-406 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:336-370 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|181| Function 'search' is too long (124 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|408| Function 'Insert' is too long (69 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|715| Function 'MultiUpsert' is too long (95 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|291 col 20| appendAssign: append result not assigned to the same slice (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|759 col 6| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|779 col 6| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|457 col 7| err113: do not compare errors directly, use errors.Is() instead: "err == errors.ErrRPCCallFailed(target, context.Canceled)" (goerr113)
pkg/gateway/lb/handler/grpc/option.go|57 col 22| mnd: Magic number: 10, in detected (gomnd)
pkg/gateway/lb/handler/grpc/handler.go|282 col 7| break with no blank line before (nlreturn)
internal/observability/metrics/version/version.go|30 col 5| reps is a global variable (gochecknoglobals)
internal/errors/errors.go|124 col 24| err113: do not compare errors directly, use errors.Is() instead: "err == target" (goerr113)
internal/k8s/node/node.go|66| Function 'Reconcile' is too long (61 > 60) (funlen)
pkg/manager/backup/cassandra/service/cassandra.go|74 col 28| (*client).getVector - ctx is unused (unparam)
pkg/agent/sidecar/service/restorer/restorer.go|122 col 40| (*restorer).startRestore$1 - result 0 (interface{}) is always nil (unparam)
pkg/agent/core/ngt/handler/grpc/handler.go|291| 291-314 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:349-374 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|349| 349-374 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:291-314 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|186| 186-220 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:222-256 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|222| 222-256 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:186-220 (dupl)
pkg/agent/sidecar/service/observer/observer.go|500 col 17| G304: Potential file inclusion via variable (gosec)
pkg/gateway/meta/usecase/vald.go|113| pkg/gateway/meta/usecase/vald.go:113: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/meta/usecase/vald.go|145| pkg/gateway/meta/usecase/vald.go:145: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/backup/usecase/vald.go|105| pkg/gateway/backup/usecase/vald.go:105: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/backup/usecase/vald.go|137| pkg/gateway/backup/usecase/vald.go:137: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/meta/service/meta.go|400| 400-430 lines are duplicate of pkg/gateway/meta/service/meta.go:462-492 (dupl)
pkg/gateway/meta/service/meta.go|462| 462-492 lines are duplicate of pkg/gateway/meta/service/meta.go:400-430 (dupl)
internal/config/redis_test.go|219 col 14| struct of size 384 bytes could be of size 376 bytes (maligned)
internal/net/grpc/pool/pool.go|151| internal/net/grpc/pool/pool.go:151: Line contains TODO/BUG/FIXME: "TODO maybe we should check neighbour poo..." (godox)

var (
l Logger
l logger.Logger
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
l is a global variable (gochecknoglobals)

}
)
// Goroutine leak is detected by `fastime`, but it should be ignored in the test because it is an external package.
var goleakIgnoreOptions = []goleak.Option{
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
goleakIgnoreOptions is a global variable (gochecknoglobals)

}

func WithLogger(logger Logger) Option {
func WithLogger(l logger.Logger) Option {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported function WithLogger should have comment or be unexported (golint)

return
}
o.logger = logger
o.logger = l
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
assignments should only be cuddled with other assignments (wsl)

// limitations under the License.
//

// Package setting stores all server application settings
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
package comment should be of the form "Package config ..." (golint)

func (g *gateway) DoMulti(ctx context.Context, num int,
f func(ctx context.Context, target string, ac vald.Client, copts ...grpc.CallOption) error) (err error) {
sctx, span := trace.StartSpan(ctx, "vald/gateway-lb/service/Gateway.DoMulti")
defer func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
defer statements should only be cuddled with expressions on same variable (wsl)

}
return nil
})
if err != nil && cur < limit {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
only one cuddle assignment allowed before if statement (wsl)

if !errors.Is(err, w.err) {
return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
}
if !reflect.DeepEqual(gotGw, w.wantGw) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
if statements should only be cuddled with assignments (wsl)

if !errors.Is(err, w.err) {
return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
}
if !reflect.DeepEqual(got, w.want) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
if statements should only be cuddled with assignments (wsl)

//

// Package service
package service
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
package should be service_test instead of service (testpackage)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

pkg/manager/compressor/service/registerer_test.go|309 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|310 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|331 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|423 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|424 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|445 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
internal/servers/server/server.go|311 col 3| only one cuddle assignment allowed before defer statement (wsl)
pkg/agent/core/ngt/service/option.go|37 col 22| mnd: Magic number: 100, in detected (gomnd)
pkg/agent/core/ngt/service/vcaches_test.go|179 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|180 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|360 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|361 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|702 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|703 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/discoverer/k8s/service/nodemap.go|214| 214-247 lines are duplicate of pkg/discoverer/k8s/service/nodemetricsmap.go:214-247 (dupl)
pkg/discoverer/k8s/service/nodemap.go|85 col 5| expungedNodeMap is a global variable (gochecknoglobals)
pkg/discoverer/k8s/service/discover.go|147 col 28| G601: Implicit memory aliasing in for loop. (gosec)
pkg/discoverer/k8s/service/discover_test.go|214 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|215 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|356 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|357 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|498 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
internal/net/grpc/pool/pool.go|151| internal/net/grpc/pool/pool.go:151: Line contains TODO/BUG/FIXME: "TODO maybe we should check neighbour poo..." (godox)
internal/net/grpc/pool/option.go|29 col 16| mnd: Magic number: 80, in detected (gomnd)
internal/net/grpc/pool/option.go|30 col 14| mnd: Magic number: 65535, in detected (gomnd)
pkg/gateway/internal/location/location_test.go|16 col 9| package should be location_test instead of location (testpackage)
pkg/gateway/backup/config/config_test.go|18 col 9| package should be config_test instead of config (testpackage)
pkg/manager/index/service/option.go|35 col 21| mnd: Magic number: 100, in detected (gomnd)
pkg/manager/index/service/option.go|36 col 23| mnd: Magic number: 10000, in detected (gomnd)
pkg/manager/compressor/handler/grpc/handler.go|50| line is 128 characters (lll)
pkg/manager/backup/cassandra/service/cassandra.go|35 col 5| columns is a global variable (gochecknoglobals)
pkg/manager/backup/cassandra/service/cassandra.go|74 col 28| (*client).getVector - ctx is unused (unparam)
internal/observability/metrics/version/version.go|30 col 5| reps is a global variable (gochecknoglobals)
pkg/gateway/meta/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
internal/log/log.go|27 col 2| l is a global variable (gochecknoglobals)
internal/k8s/node/node.go|66| Function 'Reconcile' is too long (61 > 60) (funlen)
pkg/agent/sidecar/service/restorer/restorer.go|122 col 40| (*restorer).startRestore$1 - result 0 (interface{}) is always nil (unparam)
internal/net/net.go|59 col 5| DefaultResolver is a global variable (gochecknoglobals)
pkg/agent/core/ngt/handler/grpc/handler.go|291| 291-314 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:349-374 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|349| 349-374 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:291-314 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|186| 186-220 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:222-256 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|222| 222-256 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:186-220 (dupl)
pkg/agent/core/ngt/handler/grpc/option.go|40 col 24| mnd: Magic number: 20, in detected (gomnd)
internal/db/kvs/redis/redis.go|130| Function 'newClient' is too long (61 > 60) (funlen)
internal/db/kvs/redis/redis.go|194| Function 'newClusterClient' is too long (69 > 60) (funlen)
pkg/gateway/backup/usecase/vald.go|49| Function 'New' is too long (101 > 60) (funlen)
pkg/gateway/backup/usecase/vald.go|105| pkg/gateway/backup/usecase/vald.go:105: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/backup/usecase/vald.go|137| pkg/gateway/backup/usecase/vald.go:137: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/backup/usecase/vald.go|161 col 26| mnd: Magic number: 6, in detected (gomnd)
internal/observability/trace/trace_option.go|23 col 19| mnd: Magic number: 1.0, in detected (gomnd)
pkg/gateway/meta/handler/grpc/handler.go|196| 196-230 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:232-266 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|232| 232-266 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:196-230 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|268| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|349| Function 'MultiInsert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|550| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|593 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|611 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|285 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/handler.go|366 col 3| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/backup/handler/grpc/handler.go|154| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|240| Function 'MultiInsert' has too many statements (42 > 40) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|474| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|433 col 5| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|517 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|535 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|585 col 6| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|649 col 7| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|170 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/backup/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/meta/usecase/vald.go|49| Function 'New' is too long (109 > 60) (funlen)
pkg/gateway/meta/usecase/vald.go|113| pkg/gateway/meta/usecase/vald.go:113: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/meta/usecase/vald.go|145| pkg/gateway/meta/usecase/vald.go:145: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/lb/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
pkg/gateway/meta/service/meta.go|400| 400-430 lines are duplicate of pkg/gateway/meta/service/meta.go:462-492 (dupl)
pkg/gateway/meta/service/meta.go|462| 462-492 lines are duplicate of pkg/gateway/meta/service/meta.go:400-430 (dupl)
pkg/gateway/meta/service/meta.go|136| 136-219 lines are duplicate of pkg/gateway/meta/service/meta.go:221-304 (dupl)
pkg/gateway/meta/service/meta.go|221| 221-304 lines are duplicate of pkg/gateway/meta/service/meta.go:136-219 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|336| 336-370 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:372-406 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|372| 372-406 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:336-370 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|181| Function 'search' is too long (124 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|408| Function 'Insert' is too long (69 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|715| Function 'MultiUpsert' is too long (95 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|291 col 20| appendAssign: append result not assigned to the same slice (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|759 col 6| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|779 col 6| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|457 col 7| err113: do not compare errors directly, use errors.Is() instead: "err == errors.ErrRPCCallFailed(target, context.Canceled)" (goerr113)
pkg/gateway/lb/handler/grpc/handler.go|282 col 7| break with no blank line before (nlreturn)
pkg/gateway/backup/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
internal/config/redis_test.go|219 col 14| struct of size 384 bytes could be of size 376 bytes (maligned)
pkg/manager/backup/mysql/handler/grpc/handler.go|241 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/mysql/handler/grpc/handler.go|249 col 79| toModelVector - result err is always nil (unparam)
internal/errors/errors.go|124 col 24| err113: do not compare errors directly, use errors.Is() instead: "err == target" (goerr113)
pkg/gateway/lb/usecase/vald.go|113| pkg/gateway/lb/usecase/vald.go:113: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/lb/usecase/vald.go|145| pkg/gateway/lb/usecase/vald.go:145: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
internal/net/grpc/client.go|164 col 16| Error return value of g.Close is not checked (errcheck)
internal/net/grpc/client.go|495 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
internal/net/grpc/client.go|333 col 25| Using the variable on range scope addr in function literal (scopelint)
internal/net/grpc/client.go|364| unnecessary trailing newline (whitespace)
internal/net/http/transport/roundtrip.go|55 col 24| response body must be closed (bodyclose)

[]string{
http.MethodGet,
routing.WithRoutes([]routing.Route{
{
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
composites: github.com/vdaas/vald/internal/net/http/routing.Route composite literal uses unkeyed fields (govet)

// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
del string
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
del is unused (structcheck)

// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
connector redis.Connector
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
connector is unused (structcheck)

// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
name string
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
name is unused (structcheck)

// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
r redis.Redis
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
r is unused (structcheck)

// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
v vald.Server
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
v is unused (structcheck)

@@ -84,6 +84,13 @@ func (r *registerer) PostStop(ctx context.Context) error {
if err != nil {
return err
}
defer func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
only one cuddle assignment allowed before defer statement (wsl)

@@ -186,9 +188,11 @@ func Test_registerer_PreStart(t *testing.T) {
*/
}

for _, test := range tests {
for _, tc := range tests {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)

@@ -186,9 +188,11 @@ func Test_registerer_PreStart(t *testing.T) {
*/
}

for _, test := range tests {
for _, tc := range tests {
test := tc
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)

metas: test.fields.metas,
metasMux: test.fields.metasMux,
vecs: test.fields.vecs,
vecsMu: test.fields.vecsMu,
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)

Signed-off-by: kpango <kpango@vdaas.org>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

pkg/agent/core/ngt/handler/grpc/handler.go|291| 291-314 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:349-374 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|349| 349-374 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:291-314 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|186| 186-220 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:222-256 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|222| 222-256 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:186-220 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|210| line is 173 characters (lll)
pkg/agent/core/ngt/handler/grpc/handler.go|246| line is 177 characters (lll)
pkg/agent/core/ngt/handler/grpc/handler.go|409| line is 129 characters (lll)
pkg/agent/core/ngt/handler/grpc/handler.go|500| line is 129 characters (lll)
pkg/agent/core/ngt/handler/grpc/option.go|40 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/manager/compressor/service/registerer_test.go|191 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|192 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|213 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|309 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|310 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|331 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|423 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|424 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|445 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
internal/net/tcp/dialer_test.go|265 col 24| copylocks: call of cmp.AllowUnexported copies lock value: github.com/vdaas/vald/internal/net/tcp.dialer contains sync.Map contains sync.Mutex (govet)
internal/net/tcp/dialer_test.go|266 col 25| copylocks: call of cmpopts.IgnoreFields copies lock value: github.com/vdaas/vald/internal/net/tcp.dialer contains sync.Map contains sync.Mutex (govet)
pkg/gateway/vald/handler/grpc/handler.go|303| Function 'Insert' has too many statements (51 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|410| Function 'MultiInsert' has too many statements (54 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|512| Function 'Update' is too long (68 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|687| Function 'MultiUpsert' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|831| Function 'MultiRemove' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/option.go|32 col 23| mnd: Magic number: 3, in detected (gomnd)
pkg/gateway/vald/handler/grpc/option.go|33 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/backup/usecase/vald.go|49| Function 'New' is too long (101 > 60) (funlen)
pkg/gateway/backup/usecase/vald.go|105| pkg/gateway/backup/usecase/vald.go:105: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/backup/usecase/vald.go|137| pkg/gateway/backup/usecase/vald.go:137: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/backup/usecase/vald.go|161 col 26| mnd: Magic number: 6, in detected (gomnd)
pkg/manager/replication/controller/service/discover_test.go|197 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/manager/replication/controller/service/discover_test.go|198 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/manager/replication/controller/service/discover_test.go|305 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/manager/replication/controller/service/discover_test.go|306 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
internal/k8s/pod/pod.go|68| Function 'Reconcile' is too long (78 > 60) (funlen)
internal/net/net.go|59 col 5| DefaultResolver is a global variable (gochecknoglobals)
pkg/manager/backup/cassandra/service/cassandra.go|35 col 5| columns is a global variable (gochecknoglobals)
pkg/manager/backup/cassandra/service/cassandra.go|74 col 28| (*client).getVector - ctx is unused (unparam)
pkg/manager/backup/cassandra/handler/grpc/handler.go|250 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/cassandra/handler/grpc/handler.go|258 col 79| toModelVector - result err is always nil (unparam)
pkg/manager/index/service/option.go|35 col 21| mnd: Magic number: 100, in detected (gomnd)
pkg/manager/index/service/option.go|36 col 23| mnd: Magic number: 10000, in detected (gomnd)
pkg/agent/sidecar/service/restorer/restorer.go|122 col 40| (*restorer).startRestore$1 - result 0 (interface{}) is always nil (unparam)
pkg/gateway/meta/handler/grpc/handler.go|196| 196-230 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:232-266 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|232| 232-266 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:196-230 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|268| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|349| Function 'MultiInsert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|550| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|593 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|611 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|285 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/handler.go|366 col 3| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
internal/observability/metrics/version/version.go|30 col 5| reps is a global variable (gochecknoglobals)
pkg/gateway/backup/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
internal/config/redis_test.go|219 col 14| struct of size 384 bytes could be of size 376 bytes (maligned)
pkg/gateway/lb/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
pkg/discoverer/k8s/service/nodemap.go|214| 214-247 lines are duplicate of pkg/discoverer/k8s/service/nodemetricsmap.go:214-247 (dupl)
pkg/discoverer/k8s/service/discover.go|147 col 28| G601: Implicit memory aliasing in for loop. (gosec)
pkg/gateway/meta/usecase/vald.go|113| pkg/gateway/meta/usecase/vald.go:113: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/meta/usecase/vald.go|145| pkg/gateway/meta/usecase/vald.go:145: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
internal/net/http/transport/roundtrip.go|55 col 24| response body must be closed (bodyclose)
internal/net/grpc/client.go|164 col 16| Error return value of g.Close is not checked (errcheck)
internal/net/grpc/client.go|495 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
internal/net/grpc/client.go|333 col 25| Using the variable on range scope addr in function literal (scopelint)
internal/net/grpc/client.go|364| unnecessary trailing newline (whitespace)
pkg/gateway/backup/handler/grpc/handler.go|433 col 5| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|517 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|535 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|585 col 6| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|649 col 7| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|170 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
internal/net/grpc/pool/pool.go|151| internal/net/grpc/pool/pool.go:151: Line contains TODO/BUG/FIXME: "TODO maybe we should check neighbour poo..." (godox)
pkg/gateway/lb/handler/grpc/handler.go|336| 336-370 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:372-406 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|372| 372-406 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:336-370 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|291 col 20| appendAssign: append result not assigned to the same slice (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|759 col 6| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|779 col 6| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|457 col 7| err113: do not compare errors directly, use errors.Is() instead: "err == errors.ErrRPCCallFailed(target, context.Canceled)" (goerr113)
pkg/gateway/meta/service/meta.go|400| 400-430 lines are duplicate of pkg/gateway/meta/service/meta.go:462-492 (dupl)
pkg/gateway/meta/service/meta.go|462| 462-492 lines are duplicate of pkg/gateway/meta/service/meta.go:400-430 (dupl)
pkg/gateway/meta/service/meta.go|136| 136-219 lines are duplicate of pkg/gateway/meta/service/meta.go:221-304 (dupl)
pkg/gateway/meta/service/meta.go|221| 221-304 lines are duplicate of pkg/gateway/meta/service/meta.go:136-219 (dupl)

WithAutoIndexCheckDuration("30m"),
WithAutoIndexDurationLimit("24h"),
WithAutoSaveIndexDuration("35m"),
WithAutoIndexLength(100),
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
mnd: Magic number: 100, in detected (gomnd)

@@ -173,8 +176,10 @@ func Test_vcaches_Load(t *testing.T) {
*/
}

for _, test := range tests {
for _, tc := range tests {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)

@@ -173,8 +176,10 @@ func Test_vcaches_Load(t *testing.T) {
*/
}

for _, test := range tests {
for _, tc := range tests {
test := tc
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)

@@ -350,8 +357,10 @@ func Test_vcaches_Store(t *testing.T) {
*/
}

for _, test := range tests {
for _, tc := range tests {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)

@@ -350,8 +357,10 @@ func Test_vcaches_Store(t *testing.T) {
*/
}

for _, test := range tests {
for _, tc := range tests {
test := tc
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)

if err != nil {
log.Errorf("[RemoveMulti]\tunknown error\t%+v", err)
if span != nil {
span.SetStatus(trace.StatusCodeInternal(err.Error()))
}
return nil, status.WrapWithInternal(fmt.Sprintf("RemoveMulti API uuids %#v could not DeleteMetas", uuids), err, info.Get())
return nil, status.WrapWithInternal(fmt.Sprintf("RemoveMulti API uuids %#v could not DeleteVectors", uuids), err, info.Get())
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
line is 127 characters (lll)

Meta: meta.GetMeta(),
Vector: meta.GetVector(),
Ips: meta.GetIPs(),
func toBackupVector(vector *model.Vector) (res *payload.Backup_Compressed_Vector, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
toBackupVector - result err is always nil (unparam)

}, nil
}

func toModelMetaVector(obj *payload.Backup_Compressed_MetaVector) (res *model.MetaVector, err error) {
return &model.MetaVector{
func toModelVector(obj *payload.Backup_Compressed_Vector) (res *model.Vector, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
toModelVector - result err is always nil (unparam)

var (
l Logger
l logger.Logger
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
l is a global variable (gochecknoglobals)

}
)
// Goroutine leak is detected by `fastime`, but it should be ignored in the test because it is an external package.
var goleakIgnoreOptions = []goleak.Option{
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
goleakIgnoreOptions is a global variable (gochecknoglobals)

* fix helm charts grpc host port setting for v1 API

Signed-off-by: kpango <kpango@vdaas.org>

* remove metrics-server yamls and add remote metrics-server deployment

Signed-off-by: kpango <kpango@vdaas.org>

* Change confusing naming fields.

Signed-off-by: kpango <kpango@vdaas.org>

* remove unneccessary addrs files from configuration & fix compressor helm indent

Signed-off-by: kpango <kpango@vdaas.org>

* add selectable gateway addr to helm config

Signed-off-by: kpango <kpango@vdaas.org>

* fix build failure

Signed-off-by: kpango <kpango@vdaas.org>

* fix internal test failure

Signed-off-by: kpango <kpango@vdaas.org>

* fix ingress rules

Signed-off-by: kpango <kpango@vdaas.org>

* Update get-started.md

* add wait condition for metrics server for more stable documentation

Signed-off-by: kpango <kpango@vdaas.org>
@@ -722,8 +722,8 @@ Configuration
| indexManager.indexer.auto_index_length | int | `100` | number of cache to trigger automatic indexing |
| indexManager.indexer.concurrency | int | `1` | concurrency |
| indexManager.indexer.creation_pool_size | int | `10000` | number of pool size of create index processing |
| indexManager.indexer.discoverer.agent_client | object | `{"dial_option":{"tcp":{"dialer":{"keep_alive":"15m"}}}}` | gRPC client for agents (overrides defaults.grpc.client) |
| indexManager.indexer.discoverer.discover_client | object | `{}` | gRPC client for discoverer (overrides defaults.grpc.client) |
| indexManager.indexer.discoverer.agent_client_options | object | `{"dial_option":{"tcp":{"dialer":{"keep_alive":"15m"}}}}` | gRPC client for agents (overrides defaults.grpc.client) |
Copy link
Contributor

Choose a reason for hiding this comment

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

[LanguageTool] reported by reviewdog 🐶
Insert a space between the numerical value and the unit symbol "15 m" (UNIT_SPACE[1])
Suggestions: 15 m
URL: https://www.bipm.org/en/publications/si-brochure/section5-3.html#section3
Rule: https://community.languagetool.org/rule/show/UNIT_SPACE?lang=en-US&subId=1
Category: PUNCTUATION

kubectl wait -n cert-manager --for=condition=ready pod -l app=webhook --timeout=60s
```

2. Deploy ScyllaDB Operator
Copy link
Contributor

Choose a reason for hiding this comment

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

[LanguageTool] reported by reviewdog 🐶
Please add a punctuation mark at the end of paragraph (PUNCTUATION_PARAGRAPH_END)
Suggestions: Operator., Operator!, Operator?, Operator:, Operator,, Operator;
Rule: https://community.languagetool.org/rule/show/PUNCTUATION_PARAGRAPH_END?lang=en-US
Category: PUNCTUATION

kubectl wait -n scylla-operator-system --for=condition=ready pod -l statefulset.kubernetes.io/pod-name=scylla-operator-controller-manager-0 --timeout=600s
```

3. Deploy ScyllaDB
Copy link
Contributor

Choose a reason for hiding this comment

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

[LanguageTool] reported by reviewdog 🐶
Please add a punctuation mark at the end of paragraph (PUNCTUATION_PARAGRAPH_END)
Suggestions: ScyllaDB., ScyllaDB!, ScyllaDB?, ScyllaDB:, ScyllaDB,, ScyllaDB;
Rule: https://community.languagetool.org/rule/show/PUNCTUATION_PARAGRAPH_END?lang=en-US
Category: PUNCTUATION

kubectl -n scylla get pods
```

4. Configure ScyllaDB
Copy link
Contributor

Choose a reason for hiding this comment

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

[LanguageTool] reported by reviewdog 🐶
Please add a punctuation mark at the end of paragraph (PUNCTUATION_PARAGRAPH_END)
Suggestions: ScyllaDB., ScyllaDB!, ScyllaDB?, ScyllaDB:, ScyllaDB,, ScyllaDB;
Rule: https://community.languagetool.org/rule/show/PUNCTUATION_PARAGRAPH_END?lang=en-US
Category: PUNCTUATION

Signed-off-by: kpango <kpango@vdaas.org>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

pkg/gateway/lb/handler/grpc/option.go|63 col 1| exported function WithReplicationCount should have comment or be unexported (golint)
pkg/gateway/lb/handler/grpc/option.go|71 col 1| exported function WithStreamConcurrency should have comment or be unexported (golint)
pkg/gateway/lb/handler/grpc/handler.go|72| line is 122 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|100| line is 134 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|155| line is 125 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|210| line is 125 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|360| line is 173 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|396| line is 177 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|445| line is 137 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|474| line is 131 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|494| line is 130 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|526| line is 137 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|588| line is 133 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|607| line is 129 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|645| line is 142 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|838| line is 128 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|883| line is 130 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|911| line is 122 characters (lll)
pkg/gateway/lb/handler/grpc/handler.go|977| line is 124 characters (lll)
pkg/gateway/lb/handler/grpc/option_test.go|267 col 3| dur is unused (structcheck)
pkg/gateway/lb/handler/grpc/option_test.go|33 col 3| g is unused (structcheck)
pkg/gateway/lb/handler/grpc/option_test.go|150 col 3| eg is unused (structcheck)
pkg/gateway/lb/handler/grpc/option_test.go|384 col 3| rep is unused (structcheck)
pkg/gateway/lb/handler/grpc/option_test.go|501 col 3| c is unused (structcheck)
pkg/gateway/lb/handler/grpc/handler.go|64 col 2| defer statements should only be cuddled with expressions on same variable (wsl)
pkg/gateway/lb/handler/grpc/handler.go|107 col 2| defer statements should only be cuddled with expressions on same variable (wsl)
pkg/gateway/lb/handler/grpc/handler.go|115 col 3| if statements should only be cuddled with assignments used in the if statement itself (wsl)
pkg/gateway/lb/handler/grpc/handler.go|136 col 2| defer statements should only be cuddled with expressions on same variable (wsl)
pkg/gateway/lb/handler/grpc/handler.go|143 col 3| if statements should only be cuddled with assignments used in the if statement itself (wsl)
pkg/gateway/lb/handler/grpc/handler.go|160 col 3| if statements should only be cuddled with assignments used in the if statement itself (wsl)
pkg/gateway/lb/handler/grpc/handler.go|205 col 2| expressions should not be cuddled with declarations or returns (wsl)
pkg/gateway/lb/handler/grpc/handler.go|207 col 2| only cuddled expressions if assigning variable or using from line above (wsl)
pkg/gateway/lb/handler/grpc/handler.go|279 col 5| for statements should only be cuddled with assignments used in the iteration (wsl)
pkg/gateway/lb/handler/grpc/handler.go|285 col 5| only one cuddle assignment allowed before switch statement (wsl)
pkg/gateway/lb/handler/grpc/handler.go|268 col 4| only one cuddle assignment allowed before switch statement (wsl)
pkg/gateway/lb/handler/grpc/handler.go|251 col 2| for statement without condition should never be cuddled (wsl)
pkg/gateway/lb/handler/grpc/handler.go|351 col 3| only cuddled expressions if assigning variable or using from line above (wsl)
pkg/gateway/lb/handler/grpc/handler.go|387 col 3| only cuddled expressions if assigning variable or using from line above (wsl)
pkg/gateway/lb/handler/grpc/handler.go|519 col 3| append only allowed to cuddle with appended value (wsl)
pkg/gateway/lb/handler/grpc/handler.go|627 col 3| append only allowed to cuddle with appended value (wsl)
pkg/gateway/lb/handler/grpc/handler.go|457 col 7| err113: do not compare errors directly, use errors.Is() instead: "err == errors.ErrRPCCallFailed(target, context.Canceled)" (goerr113)
pkg/gateway/lb/handler/grpc/handler.go|194 col 67| mnd: Magic number: 2, in detected (gomnd)
pkg/gateway/lb/handler/grpc/option.go|32 col 23| mnd: Magic number: 3, in detected (gomnd)
pkg/gateway/lb/handler/grpc/option.go|33 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/lb/handler/grpc/option.go|57 col 22| mnd: Magic number: 10, in detected (gomnd)
pkg/gateway/lb/handler/grpc/handler.go|282 col 7| break with no blank line before (nlreturn)
pkg/gateway/lb/handler/grpc/option_test.go|18 col 9| package should be grpc_test instead of grpc (testpackage)
pkg/meta/redis/service/option_test.go|383 col 3| name is unused (structcheck)
pkg/meta/redis/service/option_test.go|266 col 3| name is unused (structcheck)
pkg/meta/redis/service/option_test.go|149 col 3| connector is unused (structcheck)
pkg/meta/redis/service/option_test.go|500 col 3| del is unused (structcheck)
pkg/meta/redis/service/option_test.go|32 col 3| r is unused (structcheck)
pkg/meta/redis/service/option_test.go|18 col 9| package should be service_test instead of service (testpackage)
pkg/gateway/meta/handler/grpc/handler.go|196| 196-230 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:232-266 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|232| 232-266 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:196-230 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|268| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|349| Function 'MultiInsert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|550| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|593 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|611 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|75| line is 134 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|97| line is 129 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|125| line is 121 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|127| line is 129 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|220| line is 173 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|256| line is 177 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|308| line is 128 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|313| line is 131 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|325| line is 133 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|330| line is 126 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|394| line is 127 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|442| line is 123 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|694| line is 130 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|721| line is 135 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|728| line is 125 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|285 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/handler.go|366 col 3| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/option_test.go|385 col 3| c is unused (structcheck)
pkg/gateway/meta/handler/grpc/option_test.go|268 col 3| eg is unused (structcheck)
pkg/gateway/meta/handler/grpc/option_test.go|34 col 3| g is unused (structcheck)
pkg/gateway/meta/handler/grpc/option_test.go|151 col 3| m is unused (structcheck)
pkg/gateway/meta/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/backup/config/config_test.go|18 col 9| package should be config_test instead of config (testpackage)
pkg/manager/backup/mysql/handler/grpc/handler.go|50| line is 139 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|113| line is 141 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|122| line is 123 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|144| line is 160 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|155| line is 121 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|195| line is 127 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|241 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/mysql/handler/grpc/handler.go|249 col 79| toModelVector - result err is always nil (unparam)
internal/log/log.go|27 col 2| l is a global variable (gochecknoglobals)
internal/log/log_test.go|33 col 5| goleakIgnoreOptions is a global variable (gochecknoglobals)
pkg/gateway/lb/handler/rest/option_test.go|32 col 3| v is unused (structcheck)
pkg/meta/cassandra/service/option_test.go|266 col 3| name is unused (structcheck)
pkg/meta/cassandra/service/option_test.go|32 col 3| db is unused (structcheck)
pkg/gateway/vald/handler/grpc/handler.go|303| Function 'Insert' has too many statements (51 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|410| Function 'MultiInsert' has too many statements (54 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|512| Function 'Update' is too long (68 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|687| Function 'MultiUpsert' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|831| Function 'MultiRemove' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/option.go|32 col 23| mnd: Magic number: 3, in detected (gomnd)
pkg/gateway/vald/handler/grpc/option.go|33 col 24| mnd: Magic number: 20, in detected (gomnd)
internal/net/net.go|59 col 5| DefaultResolver is a global variable (gochecknoglobals)
internal/config/config.go|79 col 12| G304: Potential file inclusion via variable (gosec)
internal/config/redis_test.go|219 col 14| struct of size 384 bytes could be of size 376 bytes (maligned)
internal/db/kvs/redis/redis.go|130| Function 'newClient' is too long (61 > 60) (funlen)
internal/db/kvs/redis/redis.go|194| Function 'newClusterClient' is too long (69 > 60) (funlen)
pkg/manager/index/service/option.go|35 col 21| mnd: Magic number: 100, in detected (gomnd)
pkg/manager/index/service/option.go|36 col 23| mnd: Magic number: 10000, in detected (gomnd)
pkg/manager/index/service/indexer_test.go|204 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|205 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|333 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|334 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|459 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexer_test.go|460 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|177 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|178 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|353 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|354 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|689 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/index/service/indexinfos_test.go|690 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains sync.Mutex (govet)
pkg/manager/replication/controller/service/discover_test.go|197 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/gateway/meta/usecase/vald.go|49| Function 'New' is too long (108 > 60) (funlen)
pkg/gateway/meta/usecase/vald.go|112| pkg/gateway/meta/usecase/vald.go:112: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/meta/usecase/vald.go|144| pkg/gateway/meta/usecase/vald.go:144: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/meta/usecase/vald.go|168 col 26| mnd: Magic number: 6, in detected (gomnd)
pkg/manager/backup/cassandra/handler/grpc/handler.go|250 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/cassandra/handler/grpc/handler.go|258 col 79| toModelVector - result err is always nil (unparam)
pkg/gateway/backup/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
internal/k8s/node/node.go|66| Function 'Reconcile' is too long (61 > 60) (funlen)
pkg/gateway/backup/usecase/vald.go|49| Function 'New' is too long (100 > 60) (funlen)
pkg/gateway/backup/usecase/vald.go|104| pkg/gateway/backup/usecase/vald.go:104: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/backup/usecase/vald.go|136| pkg/gateway/backup/usecase/vald.go:136: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/backup/usecase/vald.go|160 col 26| mnd: Magic number: 6, in detected (gomnd)
internal/k8s/pod/pod.go|68| Function 'Reconcile' is too long (78 > 60) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|433 col 5| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|517 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|535 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|585 col 6| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|649 col 7| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|170 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/agent/sidecar/service/restorer/restorer.go|122 col 40| (*restorer).startRestore$1 - result 0 (interface{}) is always nil (unparam)
pkg/agent/core/ngt/handler/grpc/handler.go|291| 291-314 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:349-374 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|349| 349-374 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:291-314 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|186| 186-220 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:222-256 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|222| 222-256 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:186-220 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|91 col 2| ineffectual assignment to ctx (ineffassign)
pkg/gateway/lb/usecase/vald.go|104| pkg/gateway/lb/usecase/vald.go:104: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/lb/usecase/vald.go|136| pkg/gateway/lb/usecase/vald.go:136: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/meta/service/meta.go|399| 399-429 lines are duplicate of pkg/gateway/meta/service/meta.go:461-491 (dupl)
pkg/gateway/meta/service/meta.go|461| 461-491 lines are duplicate of pkg/gateway/meta/service/meta.go:399-429 (dupl)
pkg/gateway/meta/service/meta.go|135| 135-218 lines are duplicate of pkg/gateway/meta/service/meta.go:220-303 (dupl)
pkg/gateway/meta/service/meta.go|220| 220-303 lines are duplicate of pkg/gateway/meta/service/meta.go:135-218 (dupl)
pkg/manager/backup/cassandra/service/cassandra.go|74 col 28| (*client).getVector - ctx is unused (unparam)
internal/net/grpc/pool/pool.go|151| internal/net/grpc/pool/pool.go:151: Line contains TODO/BUG/FIXME: "TODO maybe we should check neighbour poo..." (godox)
pkg/discoverer/k8s/service/nodemap.go|214| 214-247 lines are duplicate of pkg/discoverer/k8s/service/nodemetricsmap.go:214-247 (dupl)
pkg/discoverer/k8s/service/discover.go|147 col 28| G601: Implicit memory aliasing in for loop. (gosec)
internal/net/grpc/client.go|164 col 16| Error return value of g.Close is not checked (errcheck)
internal/net/grpc/client.go|495 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
internal/net/grpc/client.go|333 col 25| Using the variable on range scope addr in function literal (scopelint)
internal/net/grpc/client.go|364| unnecessary trailing newline (whitespace)

}
)
// Goroutine leak is detected by `fastime`, but it should be ignored in the test because it is an external package.
var goleakIgnoreOptions = []goleak.Option{
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
goleakIgnoreOptions is a global variable (gochecknoglobals)

CloseFunc func()
}

func (bm *backoffMock) Do(ctx context.Context, fn func() (interface{}, error)) (interface{}, error) {
func (bm *backoffMock) Do(ctx context.Context, fn func(context.Context) (interface{}, bool, error)) (interface{}, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
line is 122 characters (lll)

func NewExpBackoff(opts ...Option) http.RoundTripper {
e := new(ert)
for _, opt := range append(defaultOpts, opts...) {
for _, opt := range append(defaultOptions, opts...) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
ranges should only be cuddled with assignments used in the iteration (wsl)

rterr = reqerr
return nil, nil
_, err = e.bo.Do(req.Context(), func(ctx context.Context) (interface{}, bool, error) {
r, err := e.roundTrip(req)
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
response body must be closed (bodyclose)

}
res = r
return r, nil
return r, false, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
return with no blank line before (nlreturn)

}

got, err := c.Exists(test.args.ctx, test.args.req)
if err := test.checkFunc(test.want, got, err); err != nil {
gotId, err := s.Exists(test.args.ctx, test.args.meta)
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
var gotId should be gotID (golint)

"github.com/vdaas/vald/pkg/gateway/lb/service"
)

type Option func(*server)
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported type Option should have comment or be unexported (golint)

WithTimeout("5s"),
}

func WithGateway(g service.Gateway) Option {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported function WithGateway should have comment or be unexported (golint)

}
}

func WithErrGroup(eg errgroup.Group) Option {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported function WithErrGroup should have comment or be unexported (golint)

}
}

func WithTimeout(dur string) Option {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported function WithTimeout should have comment or be unexported (golint)

Signed-off-by: kpango <kpango@vdaas.org>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

pkg/gateway/lb/service/option_test.go|33 col 3| c is unused (structcheck)
pkg/gateway/lb/service/option_test.go|150 col 3| eg is unused (structcheck)
pkg/agent/sidecar/service/restorer/option_test.go|385 col 3| enabled is unused (structcheck)
pkg/agent/sidecar/service/restorer/restorer.go|122 col 40| (*restorer).startRestore$1 - result 0 (interface{}) is always nil (unparam)
pkg/gateway/lb/usecase/vald.go|47| Function 'New' is too long (101 > 60) (funlen)
pkg/gateway/lb/usecase/vald.go|104| pkg/gateway/lb/usecase/vald.go:104: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/lb/usecase/vald.go|136| pkg/gateway/lb/usecase/vald.go:136: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/lb/usecase/vald.go|159 col 26| mnd: Magic number: 6, in detected (gomnd)
pkg/gateway/lb/usecase/vald_test.go|17 col 9| package should be usecase_test instead of usecase (testpackage)
internal/tls/tls_test.go|34 col 5| goleakIgnoreOptions is a global variable (gochecknoglobals)
pkg/gateway/backup/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
pkg/tools/cli/loadtest/service/loader_option.go|30 col 18| mnd: Magic number: 100, in detected (gomnd)
internal/net/http/transport/roundtrip_mock_test.go|36| line is 122 characters (lll)
internal/net/http/transport/roundtrip.go|55 col 24| response body must be closed (bodyclose)
pkg/gateway/backup/usecase/vald.go|49| Function 'New' is too long (100 > 60) (funlen)
pkg/gateway/backup/usecase/vald.go|104| pkg/gateway/backup/usecase/vald.go:104: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/backup/usecase/vald.go|136| pkg/gateway/backup/usecase/vald.go:136: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/backup/usecase/vald.go|160 col 26| mnd: Magic number: 6, in detected (gomnd)
pkg/gateway/meta/handler/grpc/handler.go|196| 196-230 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:232-266 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|232| 232-266 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:196-230 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|268| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|349| Function 'MultiInsert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|550| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|593 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|611 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|75| line is 134 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|97| line is 129 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|125| line is 121 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|127| line is 129 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|220| line is 173 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|256| line is 177 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|308| line is 128 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|313| line is 131 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|325| line is 133 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|330| line is 126 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|394| line is 127 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|416| line is 122 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|442| line is 123 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|461| line is 129 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|477| line is 122 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|694| line is 130 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|721| line is 135 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|285 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/handler.go|366 col 3| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/manager/replication/controller/service/discover_test.go|197 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/manager/replication/controller/service/discover_test.go|198 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/manager/replication/controller/service/discover_test.go|305 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/manager/replication/controller/service/discover_test.go|306 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/manager/replication/controller/service/discover_test.go|419 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/manager/replication/controller/service/discover_test.go|420 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Map contains sync.Mutex (govet)
pkg/manager/replication/controller/service/nodemap_test.go|177 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Mutex (govet)
pkg/manager/replication/controller/service/nodemap_test.go|178 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Mutex (govet)
pkg/manager/replication/controller/service/nodemap_test.go|353 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Mutex (govet)
pkg/manager/replication/controller/service/nodemap_test.go|354 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Mutex (govet)
pkg/manager/replication/controller/service/nodemap_test.go|701 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Mutex (govet)
pkg/manager/replication/controller/service/nodemap_test.go|702 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/replication/controller/service.test contains github.com/vdaas/vald/pkg/manager/replication/controller/service.fields contains sync.Mutex (govet)
internal/net/tcp/dialer_test.go|265 col 24| copylocks: call of cmp.AllowUnexported copies lock value: github.com/vdaas/vald/internal/net/tcp.dialer contains sync.Map contains sync.Mutex (govet)
internal/net/tcp/dialer_test.go|266 col 25| copylocks: call of cmpopts.IgnoreFields copies lock value: github.com/vdaas/vald/internal/net/tcp.dialer contains sync.Map contains sync.Mutex (govet)
internal/db/kvs/redis/redis.go|130| Function 'newClient' is too long (61 > 60) (funlen)
internal/db/kvs/redis/redis.go|194| Function 'newClusterClient' is too long (69 > 60) (funlen)
pkg/gateway/meta/usecase/vald.go|49| Function 'New' is too long (108 > 60) (funlen)
pkg/gateway/meta/usecase/vald.go|112| pkg/gateway/meta/usecase/vald.go:112: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/meta/usecase/vald.go|144| pkg/gateway/meta/usecase/vald.go:144: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
internal/log/log.go|27 col 2| l is a global variable (gochecknoglobals)
pkg/agent/core/ngt/service/kvs/ou_test.go|176 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|177 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|352 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|353 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|688 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/kvs/ou_test.go|689 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service/kvs.fields contains sync.Mutex (govet)
internal/k8s/pod/pod.go|68| Function 'Reconcile' is too long (78 > 60) (funlen)
pkg/gateway/meta/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
internal/config/redis_test.go|219 col 14| struct of size 384 bytes could be of size 376 bytes (maligned)
pkg/agent/core/ngt/service/vcaches_test.go|179 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|180 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|359 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|360 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|699 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
internal/k8s/node/node.go|66| Function 'Reconcile' is too long (61 > 60) (funlen)
internal/net/grpc/pool/pool.go|151| internal/net/grpc/pool/pool.go:151: Line contains TODO/BUG/FIXME: "TODO maybe we should check neighbour poo..." (godox)
internal/net/grpc/pool/option.go|29 col 16| mnd: Magic number: 80, in detected (gomnd)
internal/net/grpc/pool/option.go|30 col 14| mnd: Magic number: 65535, in detected (gomnd)
internal/io/ioutil/ioutil.go|32 col 15| Error return value of f.Close is not checked (errcheck)
pkg/gateway/lb/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
pkg/gateway/meta/service/meta.go|399| 399-429 lines are duplicate of pkg/gateway/meta/service/meta.go:461-491 (dupl)
pkg/gateway/meta/service/meta.go|461| 461-491 lines are duplicate of pkg/gateway/meta/service/meta.go:399-429 (dupl)
pkg/gateway/meta/service/meta.go|135| 135-218 lines are duplicate of pkg/gateway/meta/service/meta.go:220-303 (dupl)
pkg/gateway/meta/service/meta.go|220| 220-303 lines are duplicate of pkg/gateway/meta/service/meta.go:135-218 (dupl)
pkg/manager/backup/mysql/handler/grpc/handler.go|241 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/mysql/handler/grpc/handler.go|249 col 79| toModelVector - result err is always nil (unparam)
pkg/agent/core/ngt/handler/grpc/handler.go|291| 291-314 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:349-374 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|349| 349-374 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:291-314 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|186| 186-220 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:222-256 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|222| 222-256 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:186-220 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|336| 336-370 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:372-406 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|372| 372-406 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:336-370 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|291 col 20| appendAssign: append result not assigned to the same slice (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|759 col 6| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|779 col 6| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|457 col 7| err113: do not compare errors directly, use errors.Is() instead: "err == errors.ErrRPCCallFailed(target, context.Canceled)" (goerr113)
pkg/manager/backup/cassandra/handler/grpc/handler.go|250 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/cassandra/handler/grpc/handler.go|258 col 79| toModelVector - result err is always nil (unparam)
internal/net/grpc/client.go|164 col 16| Error return value of g.Close is not checked (errcheck)
internal/net/grpc/client.go|495 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
internal/net/grpc/client.go|333 col 25| Using the variable on range scope addr in function literal (scopelint)
internal/net/grpc/client.go|364| unnecessary trailing newline (whitespace)
pkg/discoverer/k8s/service/nodemap.go|214| 214-247 lines are duplicate of pkg/discoverer/k8s/service/nodemetricsmap.go:214-247 (dupl)
pkg/discoverer/k8s/service/discover.go|147 col 28| G601: Implicit memory aliasing in for loop. (gosec)
pkg/gateway/backup/handler/grpc/handler.go|433 col 5| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|517 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|535 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|585 col 6| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|649 col 7| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|170 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)

@@ -25,7 +25,7 @@ import (
"github.com/vdaas/vald/internal/net/http/routing"
)

// NewPProfRoutes returns PProf server route&method information from debug flag
// NewPProfRoutes returns PProf server route&method information from debug flag.
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
comment on exported function NewPProfHandler should be of the form NewPProfHandler ... (golint)

@@ -84,6 +84,13 @@ func (r *registerer) PostStop(ctx context.Context) error {
if err != nil {
return err
}
defer func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
only one cuddle assignment allowed before defer statement (wsl)

@@ -186,9 +188,11 @@ func Test_registerer_PreStart(t *testing.T) {
*/
}

for _, test := range tests {
for _, tc := range tests {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)

@@ -186,9 +188,11 @@ func Test_registerer_PreStart(t *testing.T) {
*/
}

for _, test := range tests {
for _, tc := range tests {
test := tc
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)

metas: test.fields.metas,
metasMux: test.fields.metasMux,
vecs: test.fields.vecs,
vecsMu: test.fields.vecsMu,
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)

var (
metaColumns = []string{uuidColumn, vectorColumn, metaColumn, ipsColumn}
)
var columns = []string{uuidColumn, vectorColumn, ipsColumn}
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
columns is a global variable (gochecknoglobals)

type T = interface{}
type args struct {
addr string
db cassandra.Cassandra
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
db is unused (structcheck)

var metaVector model.MetaVector
if err := c.db.Query(cassandra.Select(c.metaTable,
metaColumns,
func (c *client) getVector(ctx context.Context, uuid string) (*model.Vector, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
(*client).getVector - ctx is unused (unparam)

bt := cassandra.Batch()

entities := make(map[string]interface{}, len(metas)*4)
for i, mv := range metas {
entities := make(map[string]interface{}, len(vecs)*3)
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
mnd: Magic number: 3, in detected (gomnd)

// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
v vald.Server
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
v is unused (structcheck)

Signed-off-by: kpango <kpango@vdaas.org>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

pkg/gateway/backup/router/option_test.go|32 col 3| h is unused (structcheck)
pkg/gateway/backup/router/option_test.go|149 col 3| timeout is unused (structcheck)
pkg/gateway/backup/router/router.go|44 col 4| composites: github.com/vdaas/vald/internal/net/http/routing.Route composite literal uses unkeyed fields (govet)
pkg/gateway/backup/router/router.go|52 col 4| composites: github.com/vdaas/vald/internal/net/http/routing.Route composite literal uses unkeyed fields (govet)
pkg/gateway/backup/router/option_test.go|18 col 9| package should be router_test instead of router (testpackage)
internal/observability/metrics/version/version.go|30 col 5| reps is a global variable (gochecknoglobals)
pkg/manager/backup/mysql/handler/grpc/handler.go|50| line is 139 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|99| line is 122 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|113| line is 141 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|122| line is 123 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|128| line is 129 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|144| line is 160 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|155| line is 121 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|195| line is 127 characters (lll)
pkg/manager/backup/mysql/handler/grpc/handler.go|241 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/mysql/handler/grpc/handler.go|249 col 79| toModelVector - result err is always nil (unparam)
pkg/manager/compressor/service/registerer_test.go|191 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|192 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|213 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|309 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|310 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|331 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|423 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|424 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/manager/compressor/service.test contains github.com/vdaas/vald/pkg/manager/compressor/service.fields contains sync.Mutex (govet)
pkg/manager/compressor/service/registerer_test.go|445 col 17| copylocks: literal copies lock value from test.fields.vecsMu: sync.Mutex (govet)
internal/net/grpc/client.go|164 col 16| Error return value of g.Close is not checked (errcheck)
internal/net/grpc/client.go|486| Function 'Connect' is too long (70 > 60) (funlen)
internal/net/grpc/client.go|495 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
internal/net/grpc/client.go|344| line is 135 characters (lll)
internal/net/grpc/client.go|333 col 25| Using the variable on range scope addr in function literal (scopelint)
internal/net/grpc/option_test.go|387 col 3| flg is unused (structcheck)
internal/net/grpc/client.go|364| unnecessary trailing newline (whitespace)
internal/net/grpc/option.go|39 col 25| mnd: Magic number: 3, in detected (gomnd)
internal/net/grpc/addrs_test.go|169 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|170 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|186 col 17| copylocks: literal copies lock value from test.fields.mu: sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|266 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|267 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|283 col 17| copylocks: literal copies lock value from test.fields.mu: sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|363 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|364 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.RWMutex (govet)
internal/net/grpc/addrs_test.go|380 col 17| copylocks: literal copies lock value from test.fields.mu: sync.RWMutex (govet)
internal/net/grpc/client_test.go|224 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|225 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|256 col 26| copylocks: literal copies lock value from test.fields.crl: sync.Map contains sync.Mutex (govet)
internal/net/grpc/client_test.go|381 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|382 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|413 col 26| copylocks: literal copies lock value from test.fields.crl: sync.Map contains sync.Mutex (govet)
internal/net/grpc/client_test.go|541 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|542 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains github.com/vdaas/vald/internal/net/grpc.grpcConns contains sync.Mutex (govet)
internal/net/grpc/client_test.go|573 col 26| copylocks: literal copies lock value from test.fields.crl: sync.Map contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|178 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|179 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|354 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|355 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|690 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
internal/net/grpc/grpcconns_test.go|691 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/internal/net/grpc.test contains github.com/vdaas/vald/internal/net/grpc.fields contains sync.Mutex (govet)
pkg/manager/backup/cassandra/service/cassandra.go|35 col 5| columns is a global variable (gochecknoglobals)
pkg/manager/backup/cassandra/service/cassandra.go|74 col 28| (*client).getVector - ctx is unused (unparam)
pkg/manager/backup/cassandra/service/cassandra.go|109 col 53| mnd: Magic number: 3, in detected (gomnd)
pkg/manager/index/service/option.go|36 col 23| mnd: Magic number: 10000, in detected (gomnd)
pkg/manager/index/service/indexer_test.go|204 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/manager/index/service.test contains github.com/vdaas/vald/pkg/manager/index/service.fields contains github.com/vdaas/vald/pkg/manager/index/service.indexInfos contains sync.Mutex (govet)
internal/tls/tls_test.go|34 col 5| goleakIgnoreOptions is a global variable (gochecknoglobals)
internal/runner/option_test.go|30 col 5| goleakIgnoreOptions is a global variable (gochecknoglobals)
pkg/gateway/meta/usecase/vald.go|49| Function 'New' is too long (108 > 60) (funlen)
pkg/gateway/meta/usecase/vald.go|112| pkg/gateway/meta/usecase/vald.go:112: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/meta/usecase/vald.go|144| pkg/gateway/meta/usecase/vald.go:144: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/meta/usecase/vald.go|168 col 26| mnd: Magic number: 6, in detected (gomnd)
internal/errors/grpc.go|56| line is 135 characters (lll)
pkg/agent/core/ngt/handler/grpc/handler.go|291| 291-314 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:349-374 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|349| 349-374 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:291-314 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|186| 186-220 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:222-256 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|222| 222-256 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:186-220 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|91 col 2| ineffectual assignment to ctx (ineffassign)
pkg/agent/core/ngt/handler/grpc/handler.go|210| line is 173 characters (lll)
pkg/agent/core/ngt/handler/grpc/handler.go|246| line is 177 characters (lll)
pkg/agent/core/ngt/handler/grpc/handler.go|409| line is 129 characters (lll)
pkg/agent/core/ngt/handler/grpc/option.go|40 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/lb/router/router.go|33| Function 'New' is too long (133 > 60) (funlen)
internal/net/grpc/pool/pool.go|151| internal/net/grpc/pool/pool.go:151: Line contains TODO/BUG/FIXME: "TODO maybe we should check neighbour poo..." (godox)
internal/net/grpc/pool/option.go|29 col 16| mnd: Magic number: 80, in detected (gomnd)
internal/net/grpc/pool/option.go|30 col 14| mnd: Magic number: 65535, in detected (gomnd)
internal/k8s/pod/pod.go|68| Function 'Reconcile' is too long (78 > 60) (funlen)
internal/config/redis_test.go|219 col 14| struct of size 384 bytes could be of size 376 bytes (maligned)
pkg/gateway/lb/handler/grpc/handler.go|336| 336-370 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:372-406 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|372| 372-406 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:336-370 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|181| Function 'search' is too long (124 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|408| Function 'Insert' is too long (69 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|715| Function 'MultiUpsert' is too long (95 > 60) (funlen)
pkg/gateway/lb/handler/grpc/handler.go|291 col 20| appendAssign: append result not assigned to the same slice (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|759 col 6| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|779 col 6| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|457 col 7| err113: do not compare errors directly, use errors.Is() instead: "err == errors.ErrRPCCallFailed(target, context.Canceled)" (goerr113)
pkg/gateway/lb/handler/grpc/option.go|33 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/lb/handler/grpc/option.go|57 col 22| mnd: Magic number: 10, in detected (gomnd)
pkg/gateway/vald/handler/grpc/handler.go|303| Function 'Insert' has too many statements (51 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|410| Function 'MultiInsert' has too many statements (54 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|512| Function 'Update' is too long (68 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|687| Function 'MultiUpsert' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|831| Function 'MultiRemove' is too long (64 > 60) (funlen)
pkg/gateway/vald/handler/grpc/option.go|33 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/meta/handler/grpc/handler.go|196| 196-230 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:232-266 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|232| 232-266 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:196-230 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|268| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|349| Function 'MultiInsert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|550| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|593 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|611 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|285 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/handler.go|366 col 3| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
internal/k8s/node/node.go|66| Function 'Reconcile' is too long (61 > 60) (funlen)
pkg/gateway/backup/handler/grpc/handler.go|433 col 5| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|517 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|535 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|585 col 6| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|649 col 7| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|170 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/manager/backup/cassandra/handler/grpc/handler.go|250 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/cassandra/handler/grpc/handler.go|258 col 79| toModelVector - result err is always nil (unparam)
pkg/agent/sidecar/service/restorer/restorer.go|122 col 40| (*restorer).startRestore$1 - result 0 (interface{}) is always nil (unparam)
pkg/gateway/backup/usecase/vald.go|104| pkg/gateway/backup/usecase/vald.go:104: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/backup/usecase/vald.go|136| pkg/gateway/backup/usecase/vald.go:136: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/meta/service/meta.go|399| 399-429 lines are duplicate of pkg/gateway/meta/service/meta.go:461-491 (dupl)
pkg/gateway/meta/service/meta.go|461| 461-491 lines are duplicate of pkg/gateway/meta/service/meta.go:399-429 (dupl)
pkg/gateway/meta/service/meta.go|135| 135-218 lines are duplicate of pkg/gateway/meta/service/meta.go:220-303 (dupl)
pkg/gateway/meta/service/meta.go|220| 220-303 lines are duplicate of pkg/gateway/meta/service/meta.go:135-218 (dupl)
pkg/discoverer/k8s/service/nodemap.go|214| 214-247 lines are duplicate of pkg/discoverer/k8s/service/nodemetricsmap.go:214-247 (dupl)
pkg/discoverer/k8s/service/discover.go|147 col 28| G601: Implicit memory aliasing in for loop. (gosec)
internal/net/http/transport/roundtrip.go|55 col 24| response body must be closed (bodyclose)


func TestMockReader_Read(t *testing.T) {
t.Parallel()
type args struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
declarations should never be cuddled (wsl)

type args struct {
p []byte
}
type fields struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
declarations should never be cuddled (wsl)

type fields struct {
ReadFunc func(p []byte) (n int, err error)
}
type want struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
declarations should never be cuddled (wsl)

if !errors.Is(err, w.err) {
return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err)
}
if !reflect.DeepEqual(gotN, w.wantN) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
if statements should only be cuddled with assignments (wsl)

if !reflect.DeepEqual(gotN, w.wantN) {
return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotN, w.wantN)
}
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
return statements should not be cuddled if block has more than two lines (wsl)

@@ -14,35 +14,41 @@
// limitations under the License.
//

package swagger
// Package ioutil provides utility function for I/O
package ioutil
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
package should be ioutil_test instead of ioutil (testpackage)

Meta string `db:"meta"`
IPs []string `db:"ips"`
}
package handler
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
ST1000: at least one file in a package should have a package comment (stylecheck)

@@ -48,21 +48,21 @@ func New() Group {
// It makes sure only one execution of the function for each given key.
// If duplicate comes, the duplicated call with the same key will wait for the first caller return.
// It returns the result and the error of the given function, and whether the result is shared from the first caller.
func (g *group) Do(ctx context.Context, key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool) {
func (g *group) Do(ctx context.Context, key string, fn func() (interface{}, error)) (v interface{}, shared bool, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
line is 125 characters (lll)

type T = interface{}
type args struct {
addr string
v vald.Server
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
v is unused (structcheck)

}

// New returns REST route&method information from handler interface.
func New(opts ...Option) http.Handler {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
Function 'New' is too long (133 > 60) (funlen)

Signed-off-by: kpango <kpango@vdaas.org>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

internal/compress/gzip/gzip_test.go|187 col 3| c is unused (structcheck)
pkg/agent/core/ngt/service/option.go|37 col 22| mnd: Magic number: 100, in detected (gomnd)
pkg/agent/core/ngt/service/vcaches_test.go|179 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|180 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|359 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|360 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|699 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
pkg/agent/core/ngt/service/vcaches_test.go|700 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/agent/core/ngt/service.test contains github.com/vdaas/vald/pkg/agent/core/ngt/service.fields contains sync.Mutex (govet)
internal/config/config.go|79 col 12| G304: Potential file inclusion via variable (gosec)
internal/config/redis_test.go|219 col 14| struct of size 384 bytes could be of size 376 bytes (maligned)
pkg/meta/redis/service/option_test.go|149 col 3| connector is unused (structcheck)
pkg/meta/redis/service/option_test.go|500 col 3| del is unused (structcheck)
pkg/meta/redis/service/option_test.go|32 col 3| r is unused (structcheck)
pkg/meta/redis/service/option_test.go|383 col 3| name is unused (structcheck)
pkg/gateway/meta/handler/grpc/handler.go|196| 196-230 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:232-266 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|232| 232-266 lines are duplicate of pkg/gateway/meta/handler/grpc/handler.go:196-230 (dupl)
pkg/gateway/meta/handler/grpc/handler.go|268| Function 'Insert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|349| Function 'MultiInsert' has too many statements (45 > 40) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|550| Function 'MultiUpsert' is too long (90 > 60) (funlen)
pkg/gateway/meta/handler/grpc/handler.go|593 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|611 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/meta/handler/grpc/handler.go|75| line is 134 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|97| line is 129 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|125| line is 121 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|127| line is 129 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|220| line is 173 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|256| line is 177 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|308| line is 128 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|313| line is 131 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|325| line is 133 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|330| line is 126 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|394| line is 127 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|416| line is 122 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|442| line is 123 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|461| line is 129 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|477| line is 122 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|489| line is 122 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|694| line is 130 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|721| line is 135 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|728| line is 125 characters (lll)
pkg/gateway/meta/handler/grpc/handler.go|285 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/handler.go|366 col 3| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/gateway/meta/handler/grpc/option_test.go|34 col 3| g is unused (structcheck)
pkg/gateway/meta/handler/grpc/option_test.go|385 col 3| c is unused (structcheck)
pkg/gateway/meta/handler/grpc/option_test.go|151 col 3| m is unused (structcheck)
pkg/gateway/meta/handler/grpc/option.go|30 col 24| mnd: Magic number: 20, in detected (gomnd)
pkg/gateway/meta/handler/grpc/option_test.go|18 col 9| package should be grpc_test instead of grpc (testpackage)
pkg/gateway/internal/location/location_test.go|16 col 9| package should be location_test instead of location (testpackage)
pkg/manager/compressor/handler/grpc/handler.go|50| line is 128 characters (lll)
pkg/discoverer/k8s/service/nodemap.go|214| 214-247 lines are duplicate of pkg/discoverer/k8s/service/nodemetricsmap.go:214-247 (dupl)
pkg/discoverer/k8s/service/nodemap.go|85 col 5| expungedNodeMap is a global variable (gochecknoglobals)
pkg/discoverer/k8s/service/discover.go|147 col 28| G601: Implicit memory aliasing in for loop. (gosec)
pkg/discoverer/k8s/service/discover_test.go|214 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|215 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|356 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|357 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|498 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/discover_test.go|499 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains github.com/vdaas/vald/pkg/discoverer/k8s/service.nodeMap contains sync.Mutex (govet)
pkg/discoverer/k8s/service/nodemap_test.go|177 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains sync.Mutex (govet)
pkg/discoverer/k8s/service/nodemap_test.go|178 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains sync.Mutex (govet)
pkg/discoverer/k8s/service/nodemap_test.go|353 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains sync.Mutex (govet)
pkg/discoverer/k8s/service/nodemap_test.go|354 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains sync.Mutex (govet)
pkg/discoverer/k8s/service/nodemap_test.go|701 col 9| copylocks: range var tc copies lock: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains sync.Mutex (govet)
pkg/discoverer/k8s/service/nodemap_test.go|702 col 11| copylocks: assignment copies lock value to test: github.com/vdaas/vald/pkg/discoverer/k8s/service.test contains github.com/vdaas/vald/pkg/discoverer/k8s/service.fields contains sync.Mutex (govet)
internal/db/storage/blob/s3/reader/option_test.go|33 col 5| goleakIgnoreOptions is a global variable (gochecknoglobals)
internal/k8s/node/node.go|66| Function 'Reconcile' is too long (61 > 60) (funlen)
internal/net/net.go|59 col 5| DefaultResolver is a global variable (gochecknoglobals)
internal/net/grpc/pool/pool.go|151| internal/net/grpc/pool/pool.go:151: Line contains TODO/BUG/FIXME: "TODO maybe we should check neighbour poo..." (godox)
internal/net/grpc/pool/option.go|28 col 11| mnd: Magic number: 3, in detected (gomnd)
internal/net/grpc/pool/option.go|29 col 16| mnd: Magic number: 80, in detected (gomnd)
internal/net/grpc/pool/option.go|30 col 14| mnd: Magic number: 65535, in detected (gomnd)
internal/net/http/transport/roundtrip.go|55 col 24| response body must be closed (bodyclose)
internal/observability/trace/trace_option.go|23 col 19| mnd: Magic number: 1.0, in detected (gomnd)
pkg/gateway/meta/usecase/vald.go|49| Function 'New' is too long (108 > 60) (funlen)
pkg/gateway/meta/usecase/vald.go|112| pkg/gateway/meta/usecase/vald.go:112: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/meta/usecase/vald.go|144| pkg/gateway/meta/usecase/vald.go:144: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
pkg/gateway/meta/usecase/vald.go|168 col 26| mnd: Magic number: 6, in detected (gomnd)
pkg/manager/backup/cassandra/service/cassandra.go|35 col 5| columns is a global variable (gochecknoglobals)
pkg/manager/backup/cassandra/service/cassandra.go|74 col 28| (*client).getVector - ctx is unused (unparam)
internal/net/grpc/client.go|164 col 16| Error return value of g.Close is not checked (errcheck)
internal/net/grpc/client.go|486| Function 'Connect' is too long (70 > 60) (funlen)
internal/net/grpc/client.go|495 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
internal/net/grpc/client.go|333 col 25| Using the variable on range scope addr in function literal (scopelint)
internal/net/grpc/client.go|364| unnecessary trailing newline (whitespace)
pkg/manager/index/service/option.go|36 col 23| mnd: Magic number: 10000, in detected (gomnd)
internal/worker/queue_option.go|29 col 18| mnd: Magic number: 10, in detected (gomnd)
pkg/gateway/meta/service/meta.go|399| 399-429 lines are duplicate of pkg/gateway/meta/service/meta.go:461-491 (dupl)
pkg/gateway/meta/service/meta.go|461| 461-491 lines are duplicate of pkg/gateway/meta/service/meta.go:399-429 (dupl)
pkg/gateway/meta/service/meta.go|135| 135-218 lines are duplicate of pkg/gateway/meta/service/meta.go:220-303 (dupl)
pkg/gateway/meta/service/meta.go|220| 220-303 lines are duplicate of pkg/gateway/meta/service/meta.go:135-218 (dupl)
pkg/agent/sidecar/service/restorer/restorer.go|122 col 40| (*restorer).startRestore$1 - result 0 (interface{}) is always nil (unparam)
pkg/gateway/backup/usecase/vald.go|49| Function 'New' is too long (100 > 60) (funlen)
pkg/gateway/backup/usecase/vald.go|104| pkg/gateway/backup/usecase/vald.go:104: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/backup/usecase/vald.go|136| pkg/gateway/backup/usecase/vald.go:136: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)
internal/db/kvs/redis/redis.go|130| Function 'newClient' is too long (61 > 60) (funlen)
internal/db/kvs/redis/redis.go|194| Function 'newClusterClient' is too long (69 > 60) (funlen)
pkg/manager/backup/cassandra/handler/grpc/handler.go|250 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/cassandra/handler/grpc/handler.go|258 col 79| toModelVector - result err is always nil (unparam)
pkg/gateway/vald/handler/grpc/handler.go|303| Function 'Insert' has too many statements (51 > 40) (funlen)
pkg/gateway/vald/handler/grpc/handler.go|410| Function 'MultiInsert' has too many statements (54 > 40) (funlen)
pkg/manager/backup/mysql/handler/grpc/handler.go|241 col 83| toBackupVector - result err is always nil (unparam)
pkg/manager/backup/mysql/handler/grpc/handler.go|249 col 79| toModelVector - result err is always nil (unparam)
pkg/gateway/lb/handler/grpc/handler.go|336| 336-370 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:372-406 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|372| 372-406 lines are duplicate of pkg/gateway/lb/handler/grpc/handler.go:336-370 (dupl)
pkg/gateway/lb/handler/grpc/handler.go|291 col 20| appendAssign: append result not assigned to the same slice (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|759 col 6| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|779 col 6| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/lb/handler/grpc/handler.go|457 col 7| err113: do not compare errors directly, use errors.Is() instead: "err == errors.ErrRPCCallFailed(target, context.Canceled)" (goerr113)
pkg/gateway/backup/handler/grpc/handler.go|433 col 5| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|517 col 5| sloppyLen: len(updateReqs) <= 0 can be len(updateReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|535 col 5| sloppyLen: len(insertReqs) <= 0 can be len(insertReqs) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|585 col 6| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|649 col 7| sloppyLen: len(ips) <= 0 can be len(ips) == 0 (gocritic)
pkg/gateway/backup/handler/grpc/handler.go|170 col 2| if !req.GetConfig().GetSkipStrictExistCheck() is deeply nested (complexity: 6) (nestif)
pkg/agent/core/ngt/handler/grpc/handler.go|291| 291-314 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:349-374 (dupl)
pkg/agent/core/ngt/handler/grpc/handler.go|349| 349-374 lines are duplicate of pkg/agent/core/ngt/handler/grpc/handler.go:291-314 (dupl)
pkg/gateway/lb/usecase/vald.go|104| pkg/gateway/lb/usecase/vald.go:104: Line contains TODO/BUG/FIXME: "TODO notify another gateway and schedule..." (godox)
pkg/gateway/lb/usecase/vald.go|136| pkg/gateway/lb/usecase/vald.go:136: Line contains TODO/BUG/FIXME: "TODO add GraphQL handler" (godox)

// limitations under the License.
//

// Package setting stores all server application settings
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
package comment should be of the form "Package config ..." (golint)

)

type (
GlobalConfig = config.GlobalConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported type GlobalConfig should have comment or be unexported (golint)


type (
GlobalConfig = config.GlobalConfig
Server = config.Server
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported type Server should have comment or be unexported (golint)

Server = config.Server
)

// Config represent a application setting data content (config.yaml).
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
comment on exported type Data should be of the form "Data ..." (with optional leading article) (golint)

Gateway *config.LB `json:"gateway" yaml:"gateway"`
}

func NewConfig(path string) (cfg *Data, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported function NewConfig should have comment or be unexported (golint)

@@ -63,7 +62,7 @@ type client struct {

func New(opts ...Option) (d Client, err error) {
c := new(client)
for _, opt := range append(defaultOpts, opts...) {
for _, opt := range append(defaultOptions, opts...) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
ranges should only be cuddled with assignments used in the iteration (wsl)

// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
v vald.Server
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
v is unused (structcheck)

//

// Package rest provides rest api logic
package rest
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
package should be rest_test instead of rest (testpackage)

//

// Package rest provides rest api logic
package rest
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
package should be rest_test instead of rest (testpackage)

type test struct {
name string
args args
c *compress
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
c is unused (structcheck)

Signed-off-by: kpango <kpango@vdaas.org>
@kpango
Copy link
Collaborator Author

kpango commented Jan 12, 2021

@vdaas/set @vdaas/core @vdaas/sre Sorry for in inconvenience for a long time and sorry for making bad & huge PR.
I'm going to merge this PR. thank you for your cooperations.

@kpango kpango merged commit 96d70d2 into master Jan 12, 2021
@kpango kpango deleted the feature/apis/v1-new-design branch January 12, 2021 06:25
@vdaas-ci vdaas-ci mentioned this pull request Jan 29, 2021
18 tasks
@kpango kpango mentioned this pull request Feb 2, 2021
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment