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

How to write method checks under third-party packages #31

Closed
demoManito opened this issue Apr 6, 2023 · 1 comment
Closed

How to write method checks under third-party packages #31

demoManito opened this issue Apr 6, 2023 · 1 comment

Comments

@demoManito
Copy link

demoManito commented Apr 6, 2023

linters-settings:
  goimports:
    local-prefixes: github.com/MiaoSiLa
  forbidigo:
    forbid:
	  - 'github\.com\/jinzhu\/gorm\.Open(# do not used gorm.Open)?'

writing code as above didn't show any linter errors

@ashanbrown

@ashanbrown
Copy link
Owner

I don't believe that forbidigo matches fully-qualified names out of the box. The current behavior should match only the package name (gorm\.Open). You could try that instead. There has been an effort to allow filtering by package at golangci/golangci-lint#3612 but it hasn't been merged yet, but I suspect you'd be ok with just matching "gorm".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants