courtney icon indicating copy to clipboard operation
courtney copied to clipboard

go module support

Open LennyPenny opened this issue 4 years ago • 11 comments

Heyho, I'm trying to run this on a go module and it doesn't seem to find any of the packages.

Here's the output of go test vs courtney

lenny@localhost ~/g/xxxx> go test ./... ? gitlab.com/xxx/yyy/xxxx/cmd/service [no test files] ? gitlab.com/xxx/yyy/xxxx/config [no test files] ? gitlab.com/xxx/yyy/xxxx/model [no test files] ok gitlab.com/xxx/yyy/xxxx/pkg/extractparsers 0.011s ok gitlab.com/xxx/yyy/xxxx/pkg/filerule 0.005s ? gitlab.com/xxx/yyy/xxxx/pkg/http/rest [no test files] ? gitlab.com/xxx/yyy/xxxx/pkg/http/rest/context [no test files] ? gitlab.com/xxx/yyy/xxxx/pkg/http/rest/middleware [no test files] ? gitlab.com/xxx/yyy/xxxx/pkg/log [no test files] ok gitlab.com/xxx/yyy/xxxx/pkg/rule 0.006s ok gitlab.com/xxx/yyy/xxxx/pkg/zapi 0.004s ok gitlab.com/xxx/yyy/xxxx/util 0.003s

lenny@localhost ~/g/xxxx> courtney ./... Package not found for /home/lenny/gits/xxxx

LennyPenny avatar Feb 25 '20 12:02 LennyPenny

Aah I haven’t updated this to support modules. Not sure if I’ll get around to doing this any time soon unfortunately.

dave avatar Feb 25 '20 12:02 dave

Damn I was excited to try this tool but not supporting modules is a deal breaker for my project.

jcollum avatar Jun 10 '20 21:06 jcollum

PRs welcome!

dave avatar Jun 10 '20 21:06 dave

My team might be game for that. Do you have any guidance to offer? I'm a very new Go dev, I'm not sure where to start here.

jcollum avatar Jun 11 '20 22:06 jcollum

@dave I wanted to give it a shot to see if I could, but I'm stuck at packages.Load panicing with;

2020/12/11 16:15:51 internal error: nil Pkg importing "strconv" from "example/com/my/module/src/package"

unfortunately the packages tool is used much by people so it's hard to find other code of people using it... you got any idea?

rubensayshi avatar Dec 11 '20 15:12 rubensayshi

No idea, sorry!

dave avatar Dec 11 '20 15:12 dave

@jcollum @LennyPenny I've managed to get it to work for my repo with go mod enabled, there's a PR for review and if you could give it a shot to see if it works for you that would be very helpful; https://github.com/dave/courtney/pull/21

rubensayshi avatar Dec 15 '20 10:12 rubensayshi

This commit works for me go get -u github.com/dave/courtney@038390a12707e2d91979d2ca77a71597f4afe400

LuckyPigeon avatar Mar 15 '22 15:03 LuckyPigeon

@LuckyPigeon we merged my MR a while back, master should be working fine for go mod

rubensayshi avatar Mar 18 '22 08:03 rubensayshi

Can that be tagged such that the module can be imported cleanly?

imsodin avatar Mar 18 '22 09:03 imsodin

Ooh sorry I'll do this later today

dave avatar Mar 18 '22 10:03 dave