gogo-modulesgo-get

go get -u github.com/onsi/ginkgo/ginkgo starts throwing error all of a sudden


When I run go get -u github.com/onsi/ginkgo/ginkgo

till yesterday I had no issues. Specifically with fsnotify the output was like below

00:52:08 go: downloading gopkg.in/fsnotify.v1 v1.4.7
00:52:08 go: extracting gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
00:52:08 go: extracting gopkg.in/fsnotify.v1 v1.4.7

Now I see this error while executing same command

11:50:39 go: gopkg.in/fsnotify.v1@v1.4.8: go.mod has non-....v1 module path "github.com/fsnotify/fsnotify" at revision v1.4.8
11:50:39 go get: error loading module requirements

What might have gone wrong here


Solution

  • Some module in the transitive dependencies of github.com/onsi/ginkgo/ginkgo added a requirement on some version of gopkg.in/fsnotify.v1, which resolves to the repository hosted at github.com/fsnotify/fsnotify.

    However, the go.mod file in that repository declares its canonical import path to be github.com/fsnotify/fsnotify, not gopkg.in/fsnotify.v1.

    If you are using Go 1.14, the rest of the error message (which seems to be truncated) should tell you exactly which dependency is using the non-canonical path. The long-term fix is to move that dependency over to the canonical path and upgrade your other dependencies such that gopkg.in/fsnotify.v1 is no longer required.