You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As proposed in #32780, we have a recurring need to ban or blacklist certain packages within a Go module. It was pointed out in that issue that we really should be banning packages rather than try to reject certain packages as part of the dependency graph.
Since these packages most often end up in our go.mod files via the automatic organization of imports by our IDEs and editors (using gopls and/or goimports), it seems that goimports is the proper place to effect this "exclusion".
Therefore, I'm proposing that goimports looks for a .goimportsignore file local to the go.mod file if executed in a directory hosting a Go module. I realize that packages can be globally ignored via $GOPATH/.goimportsignore but there is a definite need to control this behavior on a module-by-module basis.
The text was updated successfully, but these errors were encountered:
As proposed in #32780, we have a recurring need to ban or blacklist certain packages within a Go module. It was pointed out in that issue that we really should be banning packages rather than try to reject certain packages as part of the dependency graph.
Since these packages most often end up in our
go.mod
files via the automatic organization of imports by our IDEs and editors (usinggopls
and/orgoimports
), it seems thatgoimports
is the proper place to effect this "exclusion".Therefore, I'm proposing that
goimports
looks for a.goimportsignore
file local to thego.mod
file if executed in a directory hosting a Go module. I realize that packages can be globally ignored via$GOPATH/.goimportsignore
but there is a definite need to control this behavior on a module-by-module basis.The text was updated successfully, but these errors were encountered: