Fix golangci-lint false-positive typecheck errors
While working on !34 (merged) golangci-lint false-positive typecheck errors started appearing:
make lint export-lib ⬆ ✭ ◼
no Go files in /Users/georgin.georgiev/gitlab/gitlab-changelog
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive.
WARN [linters context] bodyclose is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] structcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] unparam is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
config/config.go:56:13: undeclared name: `yaml` (typecheck)
decoder := yaml.NewDecoder(bytes.NewBuffer(data))
^
config/default.go:81:13: undeclared name: `yaml` (typecheck)
encoder := yaml.NewEncoder(buf)
^
commander/mock_Commander.go:14:12: _m.Called undefined (type *MockCommander has no field or method Called) (typecheck)
ret := _m.Called()
^
commander/mock_Commander.go:40:12: _m.Called undefined (type *MockCommander has no field or method Called) (typecheck)
ret := _m.Called()
^
commander/mock_Commander.go:62:26: mock.AssertExpectations undefined (type *MockCommander has no field or method AssertExpectations) (typecheck)
t.Cleanup(func() { mock.AssertExpectations(t) })
^
git/describe.go:45:2: args declared but not used (typecheck)
args := append([]string{"describe"}, opts.Args()...)
^
git/mock_Git.go:14:12: _m.Called undefined (type *MockGit has no field or method Called) (typecheck)
ret := _m.Called(opts)
^
git/mock_Git.go:38:12: _m.Called undefined (type *MockGit has no field or method Called) (typecheck)
ret := _m.Called(query, opts)
^
git/mock_Git.go:72:26: mock.AssertExpectations undefined (type *MockGit has no field or method AssertExpectations) (typecheck)
t.Cleanup(func() { mock.AssertExpectations(t) })
^
extractor/mock_Extractor.go:14:12: _m.Called undefined (type *MockExtractor has no field or method Called) (typecheck)
ret := _m.Called(startingPoint, matcher)
^
extractor/mock_Extractor.go:48:26: mock.AssertExpectations undefined (type *MockExtractor has no field or method AssertExpectations) (typecheck)
t.Cleanup(func() { mock.AssertExpectations(t) })
^
gitlab/client.go:108:14: undeclared name: `gitlab` (typecheck)
baseClient *gitlab.Client
^
gitlab/client.go:137:86: undeclared name: `gitlab` (typecheck)
func appendTransformedGitLabMergeRequests(mrs []MergeRequest, gitLabMergeRequests []*gitlab.MergeRequest) []MergeRequest {
^
gitlab/client.go:204:38: undeclared name: `gitlab` (typecheck)
func (p *mrListPaginator) GetOpts() *gitlab.ListProjectMergeRequestsOptions {
^
gitlab/mock_Client.go:14:12: _m.Called undefined (type *MockClient has no field or method Called) (typecheck)
ret := _m.Called(IIDs, perPage)
^
gitlab/mock_Client.go:48:26: mock.AssertExpectations undefined (type *MockClient has no field or method AssertExpectations) (typecheck)
t.Cleanup(func() { mock.AssertExpectations(t) })
^
scope/entries_map_builder.go:82:18: undeclared name: `intersect` (typecheck)
intersection := intersect.Hash(b.configuration.AuthorshipLabels, object.Labels())
^
scope/entries_map_builder.go:100:19: undeclared name: `intersect` (typecheck)
intersection := intersect.Hash(b.configuration.SkipChangelogLabels, object.Labels())
^
scope/entries_map_builder.go:110:18: undeclared name: `intersect` (typecheck)
intersection := intersect.Hash(compareSource, target)
^
scope/mock_EntriesMap.go:17:12: _m.Called undefined (type *MockEntriesMap has no field or method Called) (typecheck)
ret := _m.Called(scope, entry)
^
scope/mock_EntriesMap.go:31:12: _m.Called undefined (type *MockEntriesMap has no field or method Called) (typecheck)
ret := _m.Called(scope, entry)
^
scope/mock_EntriesMap.go:45:12: _m.Called undefined (type *MockEntriesMap has no field or method Called) (typecheck)
ret := _m.Called(fn)
^
scope/mock_EntriesMap.go:81:26: mock.AssertExpectations undefined (type *MockEntriesMap has no field or method AssertExpectations) (typecheck)
t.Cleanup(func() { mock.AssertExpectations(t) })
^
scope/mock_EntriesMapBuilder.go:14:12: _m.Called undefined (type *MockEntriesMapBuilder has no field or method Called) (typecheck)
ret := _m.Called(objects)
^
scope/mock_EntriesMapBuilder.go:48:26: mock.AssertExpectations undefined (type *MockEntriesMapBuilder has no field or method AssertExpectations) (typecheck)
t.Cleanup(func() { mock.AssertExpectations(t) })
^
scope/mock_Object.go:14:12: _m.Called undefined (type *MockObject has no field or method Called) (typecheck)
ret := _m.Called()
^
scope/mock_Object.go:28:5: _m.Called undefined (type *MockObject has no field or method Called) (typecheck)
_m.Called()
^
scope/mock_Object.go:33:12: _m.Called undefined (type *MockObject has no field or method Called) (typecheck)
ret := _m.Called()
^
scope/mock_Object.go:57:26: mock.AssertExpectations undefined (type *MockObject has no field or method AssertExpectations) (typecheck)
t.Cleanup(func() { mock.AssertExpectations(t) })
^
scope/entries_map_builder_test.go:123:6: missing type in composite literal (typecheck)
{
^
scope/entries_map_builder_test.go:127:6: missing type in composite literal (typecheck)
{
^
scope/entries_map_builder_test.go:131:6: missing type in composite literal (typecheck)
{
^
make: *** [lint] Error 1
Relevant job: https://gitlab.com/gitlab-org/ci-cd/runner-tools/gitlab-changelog/-/jobs/4068498868
For now I allowed this job to fail.