Azure-Samples / azure-sdk-for-go-samples

Examples of how to utilize Azure services from Go.
MIT License
296 stars 184 forks source link

running tests fails with "use of internal package not allowed" #237

Closed jbw976 closed 5 years ago

jbw976 commented 5 years ago

Thank you for your contribution and feedback! Help us review faster by providing the following information:

This issue is a: (mark with an x)

Steps to reproduce:

Run steps in https://github.com/Azure-Samples/azure-sdk-for-go-samples#to-run-tests to run the tests:

dep ensure
go test -v ./network/

Errors and log messages:

> go test -v ./network/
network/ipaddress.go:15:2: use of internal package not allowed
network/ipaddress.go:16:2: use of internal package not allowed

Expected behavior:

The tests to be invoked and execute

OS and Go versions:

go version go1.10 darwin/amd64 macOS Mojave Version 10.14.1

Further info:

hjarraya commented 5 years ago

This is not a bug, make sure you clone the azure-sdk-for-go-samples in the folder $GOPATH/src/github.com/Azure-Samples/azure-sdk-for-go-samples.

jbw976 commented 5 years ago

Thanks @hjarraya, that is the exact path that I had cloned the repo to.

jared@Jareds-MacBook-Pro ~/dev/
> cd $GOPATH/src/github.com/Azure-Samples/azure-sdk-for-go-samples
jared@Jareds-MacBook-Pro ~/dev/go/src/github.com/Azure-Samples/azure-sdk-for-go-samples
>

I just blew away the entire directory and re-cloned it now and I no longer see this behavior reproducing. I'm not sure how that fixed it, but it seems to have. I will close this issue now, thank you.

git4raj commented 5 years ago

I cleaned up the folder, did a git clone, also tried "go get -u github.com/Azure-Samples/azure-sdk-for-go-samples/..."

I have all those files in the proper path (earlier I used to get saying package not found before I cloned). when I import "github.com/Azure-Samples/azure-sdk-for-go-samples/internal/util" - it says "use of internal package not allowed...."

I'm trying to call GetStorageAccount() - that's when it gives this error message. when I goto util.go, I don't see this function. if I comment /remove the util package, it says the function "GetStorageAccount" not found.

I'm looking for a go library for SDK, which I can use to call and verify the resources are successfully created.

Appreciate your help.

git001 commented 4 years ago

I have the same problem with @git4raj with go version go1.14.2 linux/amd64. I try to run https://github.com/Azure-Samples/azure-sdk-for-go-samples/blob/master/network/ipaddress.go