I have the following dir structure
~/test
| lala
- lala.go
- main.go
And the contents:
main.go:
package main
import (
"fmt"
"./lala"
_ "github.com/lib/pq"
)
func main() {
fmt.Println(lala.asd)
}
lala.go:
package lala
import (
_ "github.com/lib/pq"
"github.com/gorilla/securecookie"
)
func asd() string {
return string(securecookie.GenerateRandomKey(32))
}
Then i execute:
~/test$ go mod init asdasd.com/asdasd
~/test$ go mod tidy
~/test$ go run main.go
But i get
lala/lala.go:6:2: cannot find package
That line is the one with the securecookie, which is a remote path.
I tried go mod init && go mod tidy
in the lala dir but the error is the same.