Skip mod-file scanning

Answered

I download additional GOPATH to project's directory for debug CI scripts.

export GOPATH="$(pwd)/.cache"
go mod download

Sometime Goland runs scanning for go.mod files in project and fails.

 

GOROOT=/usr/local/go #gosetup
GOPATH=/home/scherkesov/golang #gosetup
/usr/local/go/bin/go list -modfile=/home/scherkesov/golang/src/gitlab.XXXXXX.com/dealing-analytics/dealing-analytics/.cache/pkg/mod/github.com/hashicorp/consul/api@v1.3.0/go.mod -m -json -mod=mod all #gosetup
go: github.com/hashicorp/consul/sdk@v0.3.0 (replaced by ../sdk): reading ../sdk/go.mod: open /home/scherkesov/golang/src/gitlab.XXXXXX.com/dealing-analytics/dealing-analytics/.cache/pkg/mod/github.com/hashicorp/consul/sdk/go.mod: no such file or directory

Can I automatically create file (maybe .idea-go-mod-skip, etc) and specify "./.cache" as excluded?

0
3 comments

You can exclude /.cache directory from the IDE indexing by right-clicking on it and selecting Mark Directory as Excluded.

0

I mean I'm looking for ability to share this "exclusion rule" with source code between another team-mates.

 

0

You can add .idea directory to Git, especially projectName.iml file which contains the following entries:

<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/hello" />
</content>
0

Please sign in to leave a comment.