Re: [go-nuts] Re: Using modules with go test ./...

2018-09-23 Thread Scott Cotton
Hi @thepudds, Good to hear and glad to have followed up so as to have introduced in the conversation how to address the concern in that post. Thanks for the great summary of how to give effective feedback about about modules and the general context. Best, Scott On Saturday, 22 September

Re: [go-nuts] Re: Using modules with go test ./...

2018-09-22 Thread thepudds1460
Hi Scott, all, > "also I think they have obligated themselves to maintaining support for the current functionality, which some might not find fitting to the way they work." Regarding the concern raised in that post -- I think it is definitely not too late to give feedback on how modules

Re: [go-nuts] Re: Using modules with go test ./...

2018-09-22 Thread thepudds1460
> "I imagine I might be in the minority in using test this way. Its useful when you have a small monorepo to do tests. People who run large monorepos must have advanced tooling and individual modules won't notice the behavior change." Hi John, Stepping back, one side question: how

Re: [go-nuts] Re: Using modules with go test ./...

2018-09-21 Thread Scott Cotton
Hi all, I for one would also consider the interface an improvement if as part of making modules work outside of a "main module" included making go test ./... work as before. Perhaps ./... could mean find each top level module in src/ and test. I am not sure what the modules implementors

Re: [go-nuts] Re: Using modules with go test ./...

2018-09-21 Thread John
Thanks for the reply. Other that the bug I encountered, this seems to be the behavior. This new "mod" behavior for ./... at least for "go test" seems to be a step backwards. It assumes a kind of test methodology based around a certain type of file layout. If I am at the top of my src/ and I

Re: [go-nuts] Re: Using modules with go test ./...

2018-09-21 Thread thepudds1460
> "What I would expect with 'go test ./...' is behavior similar to what I had before modules." Hi John, all, Just to expand slightly on the points from Dave, Scott, and Paul... I suspect part of what you are encountering is that in general: 1. Modules are opt-in for Go 1.11, so by

Re: [go-nuts] Re: Using modules with go test ./...

2018-09-21 Thread John
Paul, thanks for the explanation. But I think maybe either I'm missing something or I'm not explaining something correctly. What I would expect with "go test ./..." is behavior similar to what I had before modules. That behavior would be that the go tool would recursively run all tests from

Re: [go-nuts] Re: Using modules with go test ./...

2018-09-21 Thread Paul Jolly
John, Scott is on the money with this response: > I think you need to have a main module defined so there must be a go.mod in > cwd or upwards The way to ensure that you are in a valid module context is simply: go env GOMOD which will return the path to the current (or main) module context

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread John
Gotcha. Thanks Dave. Well, looks like I'm going back to my old methods for the time being. Thanks everyone! On Thursday, September 20, 2018 at 4:26:37 PM UTC-7, Dave Cheney wrote: > > Sorry, I probably wasn’t clear or didn’t understand that you were asking. > I saw that you said GOPATH is

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread Dave Cheney
Sorry, I probably wasn’t clear or didn’t understand that you were asking. I saw that you said GOPATH is not set, it because your code is inside $HOME/go, because of the rules of the default gopath introduced in 1.8, gopath IS actually set. To be extra sure, when I’m playing with go modules I

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread John
I think I missed something in this Dave. Since my directory is already $HOME/go, isn't that what I'd want? Since my path is $HOME/go/...? I found the reference in 1.8 release notes (I would not even have gotten close with a piece of trivia like that!). I did try to move it to another

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread John
Thanks for the link. I did try the following: - Adding a main.go file and doing a go mod init, but that fails. - Just adding a go.mod file with "module main", which allowed compilation, but nothing else worked. - And of course, I added GOPATH back, but that didn't help (and I'm

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread Dave Cheney
I think because GOPATH is not set it is defaulting to $HOME/go (see Go 1.9 release notes, from memory). Try moving your code to another folder. On Friday, 21 September 2018 05:21:32 UTC+10, John wrote: > > Just started playing with modules recently. Having an issue I don't > understand,

[go-nuts] Re: Using modules with go test ./...

2018-09-20 Thread Scott Cotton
I think you need to have a main module defined so there must be a go.mod in cwd or upwards in the directory tree, perhaps also with related .go files (not sure). There are some issues such as this one where usage is confusing due to a lack of a main