Looking for a way letting gopls ignore the _test.go files

70 views
Skip to first unread message

Lin Lin

unread,
May 27, 2025, 3:07:53 PM (12 days ago) May 27
to golang-nuts
Hi, gophers

When reading Go code, one always needs to find the references of a function or a constant. Those references in the _test.go can be very noisy. I'll be great if there is a way to let gopls ignore those files. 

I failed to find such a way or configuration in gopls.  I've learned that gopls find go files with 'go list'. By now I can only hack into 'go/build/build.go' to add an environment to make 'go list' skip the Test or XTest. I wonder if there is a better way to do that?

Thanks for your time.


Reply all
Reply to author
Forward
0 new messages