You can also use the handy command `go mod download -json` to view 
information about the dependencies and where they are on disk for a module.

On Monday, 8 October 2018 22:29:46 UTC+1, ppras...@splunk.com wrote:
>
> Got it, Thanks Wagner.
> I did not set GOPATH since I was using GO111MODULE=on. Since I did not use 
> GOPATH I was having a doubt about its physical presence.
> But I found in the go root
>
> /Users/xxx/go/pkg/mod/cache....
>
> Thanks Again.
>
>
> On Monday, October 8, 2018 at 2:21:00 PM UTC-7, Wagner Riffel wrote:
>>
>> > Where is the dependent github.com/stretchr/testify/assert downloaded - 
>> I dont see it downloaded any where. 
>> it still download physically, it's under $GOPATH/pkg/mod 
>> On Mon, Oct 8, 2018 at 5:55 PM pprasanthi via golang-nuts 
>> <golan...@googlegroups.com> wrote: 
>> > 
>> > I followed below steps to run tests in go mod. In this process I had 
>> few questions that needs clarification. 
>> > 
>> > cd /tmp/gomodtry/tests/src/hello/hello_test.go 
>> > package tests 
>> > 
>> > import ( 
>> > “github.com/stretchr/testify/assert” 
>> > “os” 
>> > “testing” 
>> > ) 
>> > 
>> > func GetEnv(key string, fallback string) string { 
>> > envVariable := os.Getenv(key) 
>> > if envVariable == “” { 
>> > return fallback 
>> > } 
>> > return envVariable 
>> > } 
>> > 
>> > func TestHello(t *testing.T) { 
>> > val := GetEnv(“check”, “ok”) 
>> > assert.Equal(t, “ok”, val, “val is not equal to ok”) 
>> > } 
>> > 
>> > func TestHello1(t *testing.T) { 
>> > val := GetEnv(“check”, “ok”) 
>> > assert.Equal(t, “ok”, val, “val is not equal to ok”) 
>> > } 
>> > 
>> > export GO111MODULE=on 
>> > 
>> > go test ./… 
>> > This created go.mod and go.sum files in cd /tmp/gomodtry/ location 
>> > When I executed go test ./… -v again , it executed the tests 
>> successfully. 
>> > 
>> > QUESTION: 
>> > 
>> > Where is the dependent github.com/stretchr/testify/assert downloaded - 
>> I dont see it downloaded any where. 
>> > Before go mod concept when we set GOPATH and then go get dependency, it 
>> used to download physically. 
>> > Can you please explain how the test is resolving dependency without the 
>> physical presence of dependent library. 
>> > 
>> > In previous version, when we go get dependencies, some times we used to 
>> get 500 error because the host where dependency exists will be down 
>> temporarily. 
>> > Do we still face this kind of issues with go mod concepts? How is it 
>> handled? [we did not like vendoring of dependencies, so we end up doing go 
>> get for every test run, which made of tests runs unstable when the host 
>> went down] 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups "golang-nuts" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to golang-nuts...@googlegroups.com. 
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to