Skip to content

go get fails with "unexpected module path" #23

Description

@Dot-H

Hi,

I am trying to import your printer package in a piece of code. But the import fails with the following errors:

  • GO111MODULE=off:
package github.com/securekey/fabric-examples/fabric-cli/config: cannot find package "github.com/securekey/fabric-examples/fabric-cli/config" in any of:
	/usr/local/go/src/github.com/securekey/fabric-examples/fabric-cli/config (from $GOROOT)
	/home/doth/go/src/github.com/securekey/fabric-examples/fabric-cli/config (from $GOPATH)
  • GO111MODULE=on:
go: finding github.com/hyperledger/fabric-sdk-go/pkg/client/msp latest
go: finding github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli/printer latest
go: finding github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli latest
go: finding github.com/hyperledger/fabric-sdk-go/pkg/client latest
go: finding github.com/hyperledger/fabric-sdk-go/pkg latest
go: github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli@v0.0.0-20190412210723-f1a24020e1a5: parsing go.mod: unexpected module path "github.com/securekey/fabric-examples/fabric-cli"
go: error loading module requirements

It seems that it comes from the fact that the packages refers to the path "github.com/securekey/fabric-examples/fabric-cli" while the code is in "github.com/securekey/fabric-examples/fabric-cli/cmd/fabric-cli".

I managed to workaround the issue when GO111MODULE=off by copying the code in "cmd/fabric-cli" directly where go is expecting it.

Am I missing something when doing the go get?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions