nvim-neotest / neotest-go

MIT License
133 stars 43 forks source link

feat: search entire go.mod for the module name #36

Closed Bacbia3696 closed 1 year ago

Bacbia3696 commented 1 year ago

module name isn't always the first line in go.mod

for examples:

go 1.18

module github.com/cosmos/ibc-go/v5

old version always get the first line of go.mod -> fail to get the module name -> always return failed for every test case

akinsho commented 1 year ago

@Bacbia3696 I'm not an expert on the go.mod file but AFAICT from https://go.dev/doc/modules/gomod-ref the module is supposed to be the first line I'm not sure what exactly the example you are pointing to is but if it's not a golang team repo I'm not sure how it serves as proof since it could just be that they are making a mistake.

Bacbia3696 commented 1 year ago

There are some example that module is not the first line: https://github.com/cosmos/ibc-go/blob/main/go.mod https://github.com/cosmos/cosmos-sdk/blob/main/go.mod

And yes, it's still valid go.mod file, the go document said that module name is included in go.mod, I don't see any assert that it always the first line?

I know module name will on the first line most of the time, but when it don't, this plugin will keep telling all the tests are failed, and it's not trivial to figure out reason for plugin user like me.

Thank you for your reply!