Skip to content

lint failing with errors that do no exist #5760

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

Closed
5 of 7 tasks
Kshitij-Katiyar opened this issue Apr 23, 2025 · 9 comments
Closed
5 of 7 tasks

lint failing with errors that do no exist #5760

Kshitij-Katiyar opened this issue Apr 23, 2025 · 9 comments
Labels
question Further information is requested

Comments

@Kshitij-Katiyar
Copy link

Kshitij-Katiyar commented Apr 23, 2025

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

How did you install golangci-lint?

go install

Description of the problem

Showing error that doesn't exist

mattermost/mattermost-plugin-confluence#140

https://github.com/mattermost/mattermost-plugin-confluence/actions/runs/14616798700/job/41006777909?pr=140

Version of golangci-lint

## Install go tools
install-go-tools:
	@echo Installing go tools
	$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
	$(GO) install gotest.tools/gotestsum@v1.7.0

Configuration

?

Go environment

go 1.23.0

toolchain go1.24.1

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/ubuntu/bs/mattermost-plugin-confluence/server /home/ubuntu/bs/mattermost-plugin-confluence /home/ubuntu/bs /home/ubuntu /home /] 
INFO [config_reader] Used config file ../.golangci.yml 
INFO [lintersdb] Active 18 linters: [bodyclose errcheck gocritic gofmt goimports gosec gosimple govet ineffassign misspell nakedret revive staticcheck stylecheck typecheck unconvert unused whitespace] 
INFO [loader] Go packages loading at mode 575 (types_sizes|compiled_files|deps|imports|name|exports_file|files) took 431.685005ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 4.253876ms 
INFO [linters context/goanalysis] analyzers took 24.030259ms with top 10 stages: gocritic: 9.577536ms, the_only_name: 1.467359ms, buildir: 687.463µs, goimports: 451.603µs, buildssa: 379.916µs, gofmt: 341.192µs, misspell: 321.602µs, fact_deprecated: 303.41µs, gosec: 299.778µs, nilness: 269.402µs 
INFO [runner/max_same_issues] 40/43 issues with text "missing type in composite literal" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 10/13 issues with text "p.API undefined (type *Plugin has no field or method API)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 4/7 issues with text "n.API undefined (type *notification has no field or method API)" were hidden, use --max-same-issues 
INFO [runner] Issues before processing: 11384, after processing: 10 
INFO [runner] Processors filtering stat (out/in): sort_results: 10/10, filename_unadjuster: 11384/11384, exclude: 11384/11384, max_same_issues: 10/64, max_from_linter: 10/10, path_prefixer: 10/10, skip_dirs: 11384/11384, identifier_marker: 11384/11384, diff: 64/64, source_code: 10/10, path_shortener: 10/10, cgo: 11384/11384, autogenerated_exclude: 11384/11384, exclude-rules: 11375/11384, nolint: 11375/11375, uniq_by_line: 64/11375, path_prettifier: 11384/11384, skip_files: 11384/11384, max_per_file_from_linter: 64/64, severity-rules: 10/10 
INFO [runner] processing took 261.800058ms with stages: exclude-rules: 143.964849ms, identifier_marker: 106.125777ms, path_prettifier: 3.864289ms, nolint: 3.824326ms, autogenerated_exclude: 1.870904ms, uniq_by_line: 748.155µs, skip_dirs: 623.846µs, cgo: 392.971µs, filename_unadjuster: 246.723µs, source_code: 87.079µs, max_same_issues: 41.494µs, max_per_file_from_linter: 3.701µs, max_from_linter: 2.499µs, path_shortener: 2.016µs, exclude: 375ns, diff: 348ns, skip_files: 235ns, severity-rules: 211ns, sort_results: 187ns, path_prefixer: 73ns 
INFO [runner] linters took 4.938811298s with stages: goanalysis_metalinter: 4.676946424s 
confluence_server.go:133:5: p.API undefined (type *Plugin has no field or method API) (typecheck)
                p.API.LogError("Error occurred while fetching event data.", "Error", err.Error())
                  ^
notification.go:54:18: n.API undefined (type *notification has no field or method API) (typecheck)
                if _, err := n.API.CreatePost(post); err != nil {
                               ^
notification.go:55:6: n.API undefined (type *notification has no field or method API) (typecheck)
                        n.API.LogError("Unable to create Post in Mattermost", "Error", err.Error())
                          ^
notification.go:76:5: n.API undefined (type *notification has no field or method API) (typecheck)
                n.API.LogError("Unable to get subscribed channels for pageID.", event.Page.ID, "Error", err.Error())
                  ^
notification.go:135:6: undefined: funk (typecheck)
                if funk.Contains(events, eventType) {
                   ^
plugin.go:44:24: p.API undefined (type *Plugin has no field or method API) (typecheck)
        config.Mattermost = p.API
                              ^
plugin.go:45:35: p.API undefined (type *Plugin has no field or method API) (typecheck)
        p.client = pluginapi.NewClient(p.API, p.Driver)
                                         ^
service/delete_subscription_test.go:84:27: missing type in composite literal (typecheck)
                                                "testtesttesttest": {serializer.CommentRemovedEvent, serializer.CommentUpdatedEvent},
                                                                    ^
service/delete_subscription_test.go:89:27: missing type in composite literal (typecheck)
                                                "testtesttesttes1": {serializer.CommentCreatedEvent, serializer.CommentUpdatedEvent},
                                                                    ^
service/get_subscription_list_test.go:97:27: missing type in composite literal (typecheck)
                                                "testtesttesttest": {serializer.CommentRemovedEvent, serializer.CommentUpdatedEvent},
                                                                    ^
INFO File cache stats: 6 entries of total size 34.4KiB 
INFO Memory: 55 samples, avg is 290.7MB, max is 343.6MB 
INFO Execution took 5.381797408s                  
~/bs/mattermost-plugin-confluence/server(dependabot/go_modules/github.com/mattermost/mattermost/server/public-0.1.11)$ 

A minimal reproducible example or link to a public repository

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

@Kshitij-Katiyar Kshitij-Katiyar added the bug Something isn't working label Apr 23, 2025
Copy link

boring-cyborg bot commented Apr 23, 2025

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

@ldez ldez added question Further information is requested and removed bug Something isn't working labels Apr 23, 2025
@ldez
Copy link
Member

ldez commented Apr 23, 2025

  1. Please read the FAQ about typecheck as suggested inside the issue template.
  2. golangci-lint v1.55 doesn't support go1.24 and go1.23, you should use at least v1.60 (go1.23) or v1.64 (go1.24) but I recommend using v2.1.
  3. Using go install is strongly not recommended. https://golangci-lint.run/welcome/install/#install-from-sources

@ldez ldez closed this as completed Apr 23, 2025
@Kshitij-Katiyar
Copy link
Author

thanks @ldez

@Kshitij-Katiyar
Copy link
Author

@ldez Is the support for go install disabled for versions v2.x.x??

@Kshitij-Katiyar
Copy link
Author

@ldez Also, I was trying to use v1.60.3 with Go v1.23 and I am still facing the same errors

@ldez
Copy link
Member

ldez commented Apr 24, 2025

Please stop pinging me: I already receive notifications on comments.

@ldez
Copy link
Member

ldez commented Apr 24, 2025

  1. You didn't read the FAQ about typecheck.
  2. Your CI workflow is broken: https://github.com/mattermost/mattermost-plugin-confluence/actions/runs/14637269353/job/41071173994?pr=140#step:3:69
  3. Try things locally on a fresh clone of the repository

@ldez
Copy link
Member

ldez commented Apr 24, 2025

mattermost/mattermost-plugin-confluence#147

@Kshitij-Katiyar
Copy link
Author

Thanks

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

2 participants