2

I am importing local go modules, but I keep getting these error messages:

main.go:6:2: unknown import path "github.com/getset0/kamona/database": cannot find module providing package github.com/getset0/kamona/database client.go:5:2: unknown import path "github.com/getset0/kamona/kauth": cannot find module providing package github.com/getset0/kamona/kauth

Those files are located at my project root dir, and my go.mod is as follow:

module github.com/getset0/kamona

require (
    github.com/dgrijalva/jwt-go v3.2.0+incompatible
    github.com/golang/protobuf v1.2.0
    github.com/grpc-ecosystem/grpc-gateway v1.5.1
    github.com/mitchellh/mapstructure v1.1.2
    golang.org/x/net v0.0.0-20181114220301-adae6a3d119a
    golang.org/x/vgo v0.0.0-20180912184537-9d567625acf4 // indirect
    google.golang.org/grpc v1.16.0
)

replace github.com/getset0/kamona/kauth => ./kauth

replace github.com/getset0/kamona/database => ./database

What am I doing wrong?

Victor Oliveira
  • 1,109
  • 1
  • 12
  • 29
  • 2
    use the following commands in order to download missing packages **go get -u -v github.com/getset0/kamona/database** and **go get -u -v github.com/getset0/kamona/kauth** – Ehsan.Saradar Nov 18 '18 at 17:26

1 Answers1

3

Do you have go.mod files in ./kauth and ./database?

Normally the go.mod goes at the root of the project (which would be github.com/getset0/kamona). This would also imply you do not need to require github.com/getset0/kamona/kauth or github.com/getset0/kamona/database.

This also implies that you don't need the replace statements.

poy
  • 10,063
  • 9
  • 49
  • 74