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

Reports typecheck issues even if it is disabled explictly in command #2177

Closed
4 tasks done
pagarwal-ignitetech opened this issue Aug 17, 2021 · 8 comments
Closed
4 tasks done
Labels
question Further information is requested

Comments

@pagarwal-ignitetech
Copy link

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

I am running command

golangci-lint run --disable-all --presets unused

Still I am getting typecheck results though i need only unused results
output of command

main.go:79:20: undeclared name: `cron` (typecheck)
                cronScheduler := cron.New()
                                 ^
main.go:14:2: "github.com/robfig/cron/v3" imported but not used (typecheck)
        "github.com/robfig/cron/v3"
        ^
mocks/AWSSessions.go:26:12: _m.Called undefined (type *AWSSessions has no field or method Called) (typecheck)
        ret := _m.Called(awsRegion)
                  ^
mocks/AWSSessions.go:42:12: _m.Called undefined (type *AWSSessions has no field or method Called) (typecheck)
        ret := _m.Called(awsRegion)
                  ^
mocks/AWSSessions.go:58:12: _m.Called undefined (type *AWSSessions has no field or method Called) (typecheck)
        ret := _m.Called(awsRegion)
                  ^
mocks/ApiUrlBuilder.go:14:12: _m.Called undefined (type *ApiUrlBuilder has no field or method Called) (typecheck)
        ret := _m.Called(product, repo, buildNumber)
                  ^
mocks/AwsHelper.go:19:12: _m.Called undefined (type *AwsHelper has no field or method Called) (typecheck)
        ret := _m.Called(repositoryName)
                  ^
mocks/AwsHelper.go:42:12: _m.Called undefined (type *AwsHelper has no field or method Called) (typecheck)
        ret := _m.Called(repositoryName)
                  ^
mocks/AwsHelper.go:65:12: _m.Called undefined (type *AwsHelper has no field or method Called) (typecheck)
        ret := _m.Called(secretName, secretValue)
                  ^
mocks/AwsSettings.go:18:12: _m.Called undefined (type *AwsSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/AwsSettings.go:32:12: _m.Called undefined (type *AwsSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/AwsSettings.go:46:12: _m.Called undefined (type *AwsSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/BuildDBAccess.go:18:12: _m.Called undefined (type *BuildDBAccess has no field or method Called) (typecheck)
        ret := _m.Called(key)
                  ^
mocks/BuildDBAccess.go:41:12: _m.Called undefined (type *BuildDBAccess has no field or method Called) (typecheck)
        ret := _m.Called(key)
                  ^
mocks/BuildDBAccess.go:64:12: _m.Called undefined (type *BuildDBAccess has no field or method Called) (typecheck)
        ret := _m.Called(key, from, to)
                  ^
mocks/ChartGenerationServiceIface.go:18:12: _m.Called undefined (type *ChartGenerationServiceIface has no field or method Called) (typecheck)
        ret := _m.Called(serviceName, repoName, gitopsURL)
                  ^
mocks/ChartGenerationServiceIface.go:39:12: _m.Called undefined (type *ChartGenerationServiceIface has no field or method Called) (typecheck)
        ret := _m.Called(order, repoUrl, gitopsUrl, ecrRepo, branch, isVmwareTarget, targetOsName)
                  ^
mocks/ChartGenerationServiceIface.go:53:12: _m.Called undefined (type *ChartGenerationServiceIface has no field or method Called) (typecheck)
        ret := _m.Called(gitopsUrl)
                  ^
mocks/DNSVMWareSyncInterface.go:14:12: _m.Called undefined (type *DNSVMWareSyncInterface has no field or method Called) (typecheck)
        ret := _m.Called(serviceName, productName, environment, ips)
                  ^
mocks/DeletePREnv.go:14:12: _m.Called undefined (type *DeletePREnv has no field or method Called) (typecheck)
        ret := _m.Called(gitopsUrl, namespace)
                  ^
mocks/DevhubPipelineReader.go:20:12: _m.Called undefined (type *DevhubPipelineReader has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, githubToken)
                  ^
mocks/DevhubYamlInterface.go:20:12: _m.Called undefined (type *DevhubYamlInterface has no field or method Called) (typecheck)
        ret := _m.Called(order)
                  ^
mocks/ECRAPI.go:22:12: _m.Called undefined (type *ECRAPI has no field or method Called) (typecheck)
        ret := _m.Called(_a0)
                  ^
mocks/ECRAPI.go:45:12: _m.Called undefined (type *ECRAPI has no field or method Called) (typecheck)
        ret := _m.Called(_a0)
                  ^
mocks/ECRAPI.go:77:12: _m.Called undefined (type *ECRAPI has no field or method Called) (typecheck)
        ret := _m.Called(_ca...)
                  ^
mocks/GHTokenInterface.go:14:12: _m.Called undefined (type *GHTokenInterface has no field or method Called) (typecheck)
        ret := _m.Called(owner, repoName)
                  ^
mocks/GHTokenInterface.go:28:12: _m.Called undefined (type *GHTokenInterface has no field or method Called) (typecheck)
        ret := _m.Called(owner, repoName, token)
                  ^
mocks/GarbageCollectionIface.go:14:12: _m.Called undefined (type *GarbageCollectionIface has no field or method Called) (typecheck)
        ret := _m.Called(pipelineRunLabels)
                  ^
mocks/GeneralSettings.go:22:12: _m.Called undefined (type *GeneralSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/GeneralSettings.go:36:12: _m.Called undefined (type *GeneralSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/GeneralSettings.go:50:12: _m.Called undefined (type *GeneralSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/GetStepsService.go:18:12: _m.Called undefined (type *GetStepsService has no field or method Called) (typecheck)
        ret := _m.Called(namespace, repoName, buildNumber)
                  ^
mocks/GitHelper.go:20:12: _m.Called undefined (type *GitHelper has no field or method Called) (typecheck)
        ret := _m.Called(repo, branchName)
                  ^
mocks/GitHelper.go:43:12: _m.Called undefined (type *GitHelper has no field or method Called) (typecheck)
        ret := _m.Called(repoURL)
                  ^
mocks/GitHelper.go:66:12: _m.Called undefined (type *GitHelper has no field or method Called) (typecheck)
        ret := _m.Called(repo, workTree, commitMessage)
                  ^
mocks/GitHubClientAPI.go:18:12: _m.Called undefined (type *GitHubClientAPI has no field or method Called) (typecheck)
        ret := _m.Called(client, owner, repoName, userName, opt)
                  ^
mocks/GitHubClientAPI.go:50:12: _m.Called undefined (type *GitHubClientAPI has no field or method Called) (typecheck)
        ret := _m.Called(client, orgId, teamId, owner, repoName, opt)
                  ^
mocks/GitHubClientAPI.go:73:12: _m.Called undefined (type *GitHubClientAPI has no field or method Called) (typecheck)
        ret := _m.Called(client, owner, repoName, base, head)
                  ^
mocks/GitHubHelper.go:20:12: _m.Called undefined (type *GitHubHelper has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, userName)
                  ^
mocks/GitHubHelper.go:34:12: _m.Called undefined (type *GitHubHelper has no field or method Called) (typecheck)
        ret := _m.Called(gitRef)
                  ^
mocks/GitHubHelper.go:48:12: _m.Called undefined (type *GitHubHelper has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, teamName)
                  ^
mocks/GitRefBuilder.go:18:12: _m.Called undefined (type *GitRefBuilder has no field or method Called) (typecheck)
        ret := _m.Called(repoName, commitSha, branch, prId)
                  ^
mocks/HookInterface.go:18:12: _m.Called undefined (type *HookInterface has no field or method Called) (typecheck)
        ret := _m.Called(namespace, repoName, pipelineRunName, taskRun)
                  ^
mocks/ImportOrderReader.go:18:12: _m.Called undefined (type *ImportOrderReader has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, githubToken)
                  ^
mocks/ImportOrderReader.go:39:12: _m.Called undefined (type *ImportOrderReader has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, githubToken)
                  ^
mocks/ImportOrderValidationServiceIface.go:18:12: _m.Called undefined (type *ImportOrderValidationServiceIface has no field or method Called) (typecheck)
        ret := _m.Called(importOrderYaml, userGithubToken)
                  ^
mocks/ImportRepository.go:18:12: _m.Called undefined (type *ImportRepository has no field or method Called) (typecheck)
        ret := _m.Called(importOrderYaml, githubToken)
                  ^
mocks/JenkinsServiceInterface.go:14:12: _m.Called undefined (type *JenkinsServiceInterface has no field or method Called) (typecheck)
        ret := _m.Called(product, c4containerName, stage)
                  ^
mocks/KubernetesHelper.go:36:12: _m.Called undefined (type *KubernetesHelper has no field or method Called) (typecheck)
        ret := _m.Called(k8s, namespace)
                  ^
mocks/KubernetesHelper.go:50:12: _m.Called undefined (type *KubernetesHelper has no field or method Called) (typecheck)
        ret := _m.Called(name, sa, namespace)

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version 1.41.1 built from a2074809 on 2021-06-19T16:01:50Z

Configuration file

$ cat .golangci.yml
cat: .golangci.yml: No such file or directory

Go environment

$ go version && go env
go version go1.16.7 linux/amd64
GO111MODULE="off"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY="github.com/trilogy-group"
GONOSUMDB="github.com/trilogy-group"
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE="github.com/trilogy-group"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.7"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build521252926=/tmp/go-build -gno-record-gcc-switches

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/codebase /home / /root]
INFO [lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck]
INFO [loader] Go packages loading at mode 575 (files|exports_file|deps|imports|name|types_sizes|compiled_files) took 2.8607624s
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 214.5161ms
INFO [linters context/goanalysis] analyzers took 3.9338771s with top 10 stages: buildir: 2.8458861s, inspect: 160.9579ms, ctrlflow: 136.1401ms, fact_purity: 118.1737ms, printf: 111.4148ms, nilness: 98.1507ms, SA5012: 84.5083ms, fact_deprecated: 76.8623ms, typedness: 60.2188ms, isgenerated: 27.7155ms
INFO [runner/max_same_issues] 279/282 issues with text "_m.Called undefined (type *S3API has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 175/178 issues with text "_m.Called undefined (type *Route53API has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 98/101 issues with text "_m.Called undefined (type *ECRAPI has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 57/60 issues with text "_m.Called undefined (type *SQSAPI has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 55/58 issues with text "_m.Called undefined (type *SecretsManagerAPI has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 36/39 issues with text "_m.Called undefined (type *GeneralSettings has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 36/39 issues with text "undeclared name: `yaml`" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 35/38 issues with text "undeclared name: `git`" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 26/29 issues with text "_m.Called undefined (type *KubernetesHelper has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 24/27 issues with text "_m.Called undefined (type *GitHubHelper has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 23/26 issues with text "_m.Called undefined (type *GitHubClientAPI has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 13/16 issues with text "\"gopkg.in/yaml.v3\" imported but not used" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 10/13 issues with text "_m.Called undefined (type *AwsHelper has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 10/13 issues with text "undeclared name: `validator`" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 8/11 issues with text "_m.Called undefined (type *AwsSettings has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 6/9 issues with text "_m.Called undefined (type *NexusSettingsInterface has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 4/7 issues with text "\"gopkg.in/src-d/go-git.v4\" imported but not used" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 3/6 issues with text "undeclared name: `assert`" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 2/5 issues with text "undeclared name: `jira`" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 2/5 issues with text "undeclared name: `jwt`" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 2/5 issues with text "_m.Called undefined (type *BuildDBAccess has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 2/5 issues with text "_m.Called undefined (type *AWSSessions has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 1/4 issues with text "_m.Called undefined (type *GitHelper has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 1/4 issues with text "_m.Called undefined (type *PipelineManagement has no field or method Called)" were hidden, use --max-same-issues
INFO [runner/max_same_issues] 1/4 issues with text "importOrderController.ValidateImportOrder undefined (type *testImportOrderController has no field or method ValidateImportOrder)" were hidden, use --max-same-issues
INFO [runner/max_from_linter] 106/156 issues from linter typecheck were hidden, use --max-issues-per-linter
INFO [runner] Issues before processing: 148497, after processing: 50
INFO [runner] Processors filtering stat (out/in): identifier_marker: 148497/148497, max_same_issues: 156/1065, source_code: 50/50, severity-rules: 50/50, autogenerated_exclude: 148497/148497, exclude-rules: 148497/148497, path_prefixer: 50/50, max_per_file_from_linter: 1065/1065, max_from_linter: 50/156, sort_results: 50/50, filename_unadjuster: 148497/148497, path_prettifier: 148497/148497, exclude: 148497/148497, nolint: 148497/148497, diff: 1065/1065, path_shortener: 50/50, cgo: 148497/148497, skip_files: 148497/148497, skip_dirs: 148497/148497, uniq_by_line: 1065/148497
INFO [runner] processing took 11.092283s with stages: exclude-rules: 7.5572288s, identifier_marker: 2.8379745s, nolint: 318.2206ms, path_prettifier: 226.41ms, source_code: 58.4167ms, skip_dirs: 26.3089ms, filename_unadjuster: 20.876ms, cgo: 17.6402ms, uniq_by_line: 16.8369ms, autogenerated_exclude: 11.4504ms, max_same_issues: 769.7µs, max_per_file_from_linter: 93.2µs, max_from_linter: 44.9µs, path_shortener: 9.4µs, exclude: 1µs, diff: 600ns, skip_files: 500ns, sort_results: 400ns, severity-rules: 200ns, path_prefixer: 100ns
INFO [runner] linters took 13.793196s with stages: goanalysis_metalinter: 2.7006752s
main.go:79:20: undeclared name: `cron` (typecheck)
                cronScheduler := cron.New()
                                 ^
main.go:14:2: "github.com/robfig/cron/v3" imported but not used (typecheck)
        "github.com/robfig/cron/v3"
        ^
mocks/AWSSessions.go:26:12: _m.Called undefined (type *AWSSessions has no field or method Called) (typecheck)
        ret := _m.Called(awsRegion)
                  ^
mocks/AWSSessions.go:42:12: _m.Called undefined (type *AWSSessions has no field or method Called) (typecheck)
        ret := _m.Called(awsRegion)
                  ^
mocks/AWSSessions.go:58:12: _m.Called undefined (type *AWSSessions has no field or method Called) (typecheck)
        ret := _m.Called(awsRegion)
                  ^
mocks/ApiUrlBuilder.go:14:12: _m.Called undefined (type *ApiUrlBuilder has no field or method Called) (typecheck)
        ret := _m.Called(product, repo, buildNumber)
                  ^
mocks/AwsHelper.go:19:12: _m.Called undefined (type *AwsHelper has no field or method Called) (typecheck)
        ret := _m.Called(repositoryName)
                  ^
mocks/AwsHelper.go:42:12: _m.Called undefined (type *AwsHelper has no field or method Called) (typecheck)
        ret := _m.Called(repositoryName)
                  ^
mocks/AwsHelper.go:65:12: _m.Called undefined (type *AwsHelper has no field or method Called) (typecheck)
        ret := _m.Called(secretName, secretValue)
                  ^
mocks/AwsSettings.go:18:12: _m.Called undefined (type *AwsSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/AwsSettings.go:32:12: _m.Called undefined (type *AwsSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/AwsSettings.go:46:12: _m.Called undefined (type *AwsSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/BuildDBAccess.go:18:12: _m.Called undefined (type *BuildDBAccess has no field or method Called) (typecheck)
        ret := _m.Called(key)
                  ^
mocks/BuildDBAccess.go:41:12: _m.Called undefined (type *BuildDBAccess has no field or method Called) (typecheck)
        ret := _m.Called(key)
                  ^
mocks/BuildDBAccess.go:64:12: _m.Called undefined (type *BuildDBAccess has no field or method Called) (typecheck)
        ret := _m.Called(key, from, to)
                  ^
mocks/ChartGenerationServiceIface.go:18:12: _m.Called undefined (type *ChartGenerationServiceIface has no field or method Called) (typecheck)
        ret := _m.Called(serviceName, repoName, gitopsURL)
                  ^
mocks/ChartGenerationServiceIface.go:39:12: _m.Called undefined (type *ChartGenerationServiceIface has no field or method Called) (typecheck)
        ret := _m.Called(order, repoUrl, gitopsUrl, ecrRepo, branch, isVmwareTarget, targetOsName)
                  ^
mocks/ChartGenerationServiceIface.go:53:12: _m.Called undefined (type *ChartGenerationServiceIface has no field or method Called) (typecheck)
        ret := _m.Called(gitopsUrl)
                  ^
mocks/DNSVMWareSyncInterface.go:14:12: _m.Called undefined (type *DNSVMWareSyncInterface has no field or method Called) (typecheck)
        ret := _m.Called(serviceName, productName, environment, ips)
                  ^
mocks/DeletePREnv.go:14:12: _m.Called undefined (type *DeletePREnv has no field or method Called) (typecheck)
        ret := _m.Called(gitopsUrl, namespace)
                  ^
mocks/DevhubPipelineReader.go:20:12: _m.Called undefined (type *DevhubPipelineReader has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, githubToken)
                  ^
mocks/DevhubYamlInterface.go:20:12: _m.Called undefined (type *DevhubYamlInterface has no field or method Called) (typecheck)
        ret := _m.Called(order)
                  ^
mocks/ECRAPI.go:22:12: _m.Called undefined (type *ECRAPI has no field or method Called) (typecheck)
        ret := _m.Called(_a0)
                  ^
mocks/ECRAPI.go:45:12: _m.Called undefined (type *ECRAPI has no field or method Called) (typecheck)
        ret := _m.Called(_a0)
                  ^
mocks/ECRAPI.go:77:12: _m.Called undefined (type *ECRAPI has no field or method Called) (typecheck)
        ret := _m.Called(_ca...)
                  ^
mocks/GHTokenInterface.go:14:12: _m.Called undefined (type *GHTokenInterface has no field or method Called) (typecheck)
        ret := _m.Called(owner, repoName)
                  ^
mocks/GHTokenInterface.go:28:12: _m.Called undefined (type *GHTokenInterface has no field or method Called) (typecheck)
        ret := _m.Called(owner, repoName, token)
                  ^
mocks/GarbageCollectionIface.go:14:12: _m.Called undefined (type *GarbageCollectionIface has no field or method Called) (typecheck)
        ret := _m.Called(pipelineRunLabels)
                  ^
mocks/GeneralSettings.go:22:12: _m.Called undefined (type *GeneralSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/GeneralSettings.go:36:12: _m.Called undefined (type *GeneralSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/GeneralSettings.go:50:12: _m.Called undefined (type *GeneralSettings has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
mocks/GetStepsService.go:18:12: _m.Called undefined (type *GetStepsService has no field or method Called) (typecheck)
        ret := _m.Called(namespace, repoName, buildNumber)
                  ^
mocks/GitHelper.go:20:12: _m.Called undefined (type *GitHelper has no field or method Called) (typecheck)
        ret := _m.Called(repo, branchName)
                  ^
mocks/GitHelper.go:43:12: _m.Called undefined (type *GitHelper has no field or method Called) (typecheck)
        ret := _m.Called(repoURL)
                  ^
mocks/GitHelper.go:66:12: _m.Called undefined (type *GitHelper has no field or method Called) (typecheck)
        ret := _m.Called(repo, workTree, commitMessage)
                  ^
mocks/GitHubClientAPI.go:18:12: _m.Called undefined (type *GitHubClientAPI has no field or method Called) (typecheck)
        ret := _m.Called(client, owner, repoName, userName, opt)
                  ^
mocks/GitHubClientAPI.go:50:12: _m.Called undefined (type *GitHubClientAPI has no field or method Called) (typecheck)
        ret := _m.Called(client, orgId, teamId, owner, repoName, opt)
                  ^
mocks/GitHubClientAPI.go:73:12: _m.Called undefined (type *GitHubClientAPI has no field or method Called) (typecheck)
        ret := _m.Called(client, owner, repoName, base, head)
                  ^
mocks/GitHubHelper.go:20:12: _m.Called undefined (type *GitHubHelper has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, userName)
                  ^
mocks/GitHubHelper.go:34:12: _m.Called undefined (type *GitHubHelper has no field or method Called) (typecheck)
        ret := _m.Called(gitRef)
                  ^
mocks/GitHubHelper.go:48:12: _m.Called undefined (type *GitHubHelper has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, teamName)
                  ^
mocks/GitRefBuilder.go:18:12: _m.Called undefined (type *GitRefBuilder has no field or method Called) (typecheck)
        ret := _m.Called(repoName, commitSha, branch, prId)
                  ^
mocks/HookInterface.go:18:12: _m.Called undefined (type *HookInterface has no field or method Called) (typecheck)
        ret := _m.Called(namespace, repoName, pipelineRunName, taskRun)
                  ^
mocks/ImportOrderReader.go:18:12: _m.Called undefined (type *ImportOrderReader has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, githubToken)
                  ^
mocks/ImportOrderReader.go:39:12: _m.Called undefined (type *ImportOrderReader has no field or method Called) (typecheck)
        ret := _m.Called(gitRef, githubToken)
                  ^
mocks/ImportOrderValidationServiceIface.go:18:12: _m.Called undefined (type *ImportOrderValidationServiceIface has no field or method Called) (typecheck)
        ret := _m.Called(importOrderYaml, userGithubToken)
                  ^
mocks/ImportRepository.go:18:12: _m.Called undefined (type *ImportRepository has no field or method Called) (typecheck)
        ret := _m.Called(importOrderYaml, githubToken)
                  ^
mocks/JenkinsServiceInterface.go:14:12: _m.Called undefined (type *JenkinsServiceInterface has no field or method Called) (typecheck)
        ret := _m.Called(product, c4containerName, stage)
                  ^
mocks/KubernetesHelper.go:36:12: _m.Called undefined (type *KubernetesHelper has no field or method Called) (typecheck)
        ret := _m.Called(k8s, namespace)
                  ^
mocks/KubernetesHelper.go:50:12: _m.Called undefined (type *KubernetesHelper has no field or method Called) (typecheck)
        ret := _m.Called(name, sa, namespace)
                  ^
INFO File cache stats: 26 entries of total size 178.4KiB
INFO Memory: 170 samples, avg is 359.8MB, max is 474.4MB
INFO Execution took 16.8786571s

Code example or link to a public repository

happening for all go repos.
@pagarwal-ignitetech pagarwal-ignitetech added the bug Something isn't working label Aug 17, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 17, 2021

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@pagarwal-ignitetech
Copy link
Author

this is happening only in linux container, on windows it worked fine with same version

@ldez
Copy link
Member

ldez commented Aug 17, 2021

Hello, typecheck is not a real linter it's just a way to display "compilation" error.

Duplicate of #2063, #2014, and some other issues.

@ldez ldez closed this as completed Aug 17, 2021
@ldez ldez added question Further information is requested and removed bug Something isn't working labels Aug 17, 2021
@go-goll
Copy link

go-goll commented Oct 27, 2021

I meet the same problem, the solution:export CGO_ENABLED=0

@morigs
Copy link

morigs commented Jan 28, 2022

@ldez could you please explain why this is not a bug? The documentation lists typecheck as "enabled by default linter" which in my opinion assumes that it can be disabled. Also, --disable typecheck is perfectly valid and issues no errors.
So at least there is some validation and documentation missing.

But TBH, I want to see this as a feature. In our case, typecheck produce errors because of Go version mismatch (we use beta). The project is compiled without errors, but linting is failing.

@ldez
Copy link
Member

ldez commented Jan 28, 2022

golangci-lint is currently not compatible with go1.18. (#2438)

typecheck is not real a linter, it just catches the errors produced by the core analyzer which is a part of Go or the errors produced by the linters them-self.
If typecheck catches an error, it means that one or more of the linters will not work. because if an error occurs the linter stop, it's not a golanci-lint behavior it's a Go behavior (same behavior as the compiler).
So it's not possible to disable typecheck and expect it to work.

@morigs
Copy link

morigs commented Jan 29, 2022

OK, perhaps it should be explicitly stated somewhere? Some warning in the docs, probably.
Because right now it looks like hidden knowledge to me)

@wesleymotaaraujo

This comment was marked as off-topic.

jordanschalm added a commit to onflow/flow-go that referenced this issue Mar 3, 2023
When there are "real" lint errors, the linter will flood the output with
spurious errors from the typecheck linter (which is not a real linter:
golangci/golangci-lint#2177).

typecheck errors are triggered when the Go compilation frontend fails -
it's not clear why a compilation error elsewhere triggers all the
spurious errors from AccessNodeBuilder etc. But disabling these makes it
easier to find the real comppilation error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants