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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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?