go-pry icon indicating copy to clipboard operation
go-pry copied to clipboard

Ability to run go-pry outside of main package

Open catherinetcai opened this issue 6 years ago • 4 comments

I'm wondering if it's in the scope of go-pry to eventually allow it to run in non-main packages. The way I currently have my Go project set up is to have a main package that sources certain functionalities from a ton of subpackages.

catherinetcai avatar Jul 11 '17 20:07 catherinetcai

Yeah, it'd be definitely nice to support non-main packages. Since go-pry works by injecting code you'd either have to specify the package or do a very expensive scan of the entire dependency tree.

On Tue, Jul 11, 2017, 13:13 Catherine Cai [email protected] wrote:

I'm wondering if it's in the scope of go-pry to eventually allow it to run in non-main packages. The way I currently have my Go project set up is to have a main package that sources certain functionalities from a ton of subpackages.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/d4l3k/go-pry/issues/19, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3fMMzEljNTtKRZfEB-EzWPohLztCqCks5sM9dqgaJpZM4OUwSv .

d4l3k avatar Jul 11 '17 22:07 d4l3k

Sub packages within the same directory should work however

On Tue, Jul 11, 2017, 15:09 Tristan Rice [email protected] wrote:

Yeah, it'd be definitely nice to support non-main packages. Since go-pry works by injecting code you'd either have to specify the package or do a very expensive scan of the entire dependency tree.

On Tue, Jul 11, 2017, 13:13 Catherine Cai [email protected] wrote:

I'm wondering if it's in the scope of go-pry to eventually allow it to run in non-main packages. The way I currently have my Go project set up is to have a main package that sources certain functionalities from a ton of subpackages.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/d4l3k/go-pry/issues/19, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3fMMzEljNTtKRZfEB-EzWPohLztCqCks5sM9dqgaJpZM4OUwSv .

d4l3k avatar Jul 11 '17 22:07 d4l3k

Hi @d4l3k thx for you great project. I am comming from Ruby environment so I am very happy to see a REPL for go 🚀 Just a question is there already a way how I could specify non-main package?

tomaswitek avatar Oct 04 '17 06:10 tomaswitek

There's currently no way, but it jwould make a lot of sense to add a new flag to specify extra packages to pry into. Like go-pry run -pkgs="pkg1,pkg2" foo.go

d4l3k avatar Oct 05 '17 19:10 d4l3k