"go build" breaks with go modules -- error messages says repo is trying to import itself...

212 views
Skip to first unread message

christop...@wework.com

unread,
Jul 2, 2019, 5:53:29 PM7/2/19
to golang-nuts
Hello, I'm migrating my codebase from dep to go modules. I'm able to run go get ./... without any problems but when I run go build I get the following error message:

can't load package: package github.com/WeConnect/alpha: unknown import path "github.com/WeConnect/alpha": cannot find module providing package github.com/WeConnect/alpha

The repository I'm working from is WeConnect/alpha which is weird because the error message seems like my repository is breaking because it can't import itself. Could someone tell me what's going on underneath the hood to give me this crazy error message? Thanks

Burak Serdar

unread,
Jul 2, 2019, 5:57:02 PM7/2/19
to christop...@wework.com, golang-nuts
Did you run go mod init github.com/WeConnect/alpha?

>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/f4c4f22e-2ff5-42f5-9032-3eca8280f54f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Christopher Dang

unread,
Jul 2, 2019, 6:35:20 PM7/2/19
to Burak Serdar, golang-nuts
yes. i was able to get it to work with "go build ./..."
Reply all
Reply to author
Forward
0 new messages