blackfriday
blackfriday copied to clipboard
Code no longer builds due to broken URL github.com/russross/blackfriday/v2
We use packages that uses blackfriday and today we got
github.com/russross/blackfriday (download)
[13:54:28]package github.com/russross/blackfriday/v2: cannot find package "github.com/russross/blackfriday/v2" in any of:
[13:54:28] /opt/go/src/github.com/russross/blackfriday/v2 (from $GOROOT)
[13:54:28] /opt/TeamCity/buildAgent/work/34f7a3c3b5ec8423/server/syntropy3/src/go/src/github.com/russross/blackfriday/v2 (from $GOPATH)
I checked that the URL of github.com/russross/blackfriday/v2 is not valid.
Anything changed recently? Our daily builds have been working for quite a long time.
Thanks Shi
What version of Go are you using?
We are using go version go1.9.2 linux/amd64
. thanks
It’s related to Go modules. You need at least 1.9.7. See https://github.com/golang/go/wiki/Modules.
@moorereason I have Go 1.11. So what gives?
import "gopkg.in/russross/blackfriday.v2"
$ go build
go: downloading gopkg.in/russross/blackfriday.v2 v2.0.1
build fancypackage: cannot find module for path gopkg.in/russross/blackfriday.v2
@wizardist, not sure, but it's unrelated to this issue.
@moorereason yeah, maybe a bug in go mod, maybe smelly package cache, but import "github.com/russross/blackfriday/v2"
worked.
@moorereason I have Go 1.11. So what gives?
import "gopkg.in/russross/blackfriday.v2"
$ go build go: downloading gopkg.in/russross/blackfriday.v2 v2.0.1 build fancypackage: cannot find module for path gopkg.in/russross/blackfriday.v2
I am experience this problem too when doing Travis CI, on local everything OK. Any update on this?
I had this problem with skaffold importing "gopkg.in/russross/blackfriday.v2"
My workaround is to use a replace
directive in my go.mod
:
replace gopkg.in/russross/blackfriday.v2 => github.com/russross/blackfriday/v2 v2.0.1
@bttk
replace gopkg.in/russross/blackfriday.v2 => github.com/russross/blackfriday/v2 v2.0.1
Thank you! You just made my day! I've spent hours because of this:
go: gopkg.in/russross/[email protected]: go.mod has non-....v2 module path "github.com/russross/blackfriday/v2" at revision v2.0.1
go get: error loading module requirements
Now go build
works without complains. – Just out of curiosity: What made you think of that workaround?
@mwat56 I saw the same error
At first I thought it was an error in the module path, but go docs say it is an exception for paths in gopkg.in
I saw, that replace
can be used to override version and location, so I used it.
@bttk I am having a similar issue, what was your remediation?
@tbarbugli
I am having a similar issue, what was your remediation?
In go.mod
this:
require (
// …
gopkg.in/russross/blackfriday.v2 v2.0.1
)
replace gopkg.in/russross/blackfriday.v2 => github.com/russross/blackfriday/v2 v2.0.1
Hope it helps.
when i use this `require ( // … gopkg.in/russross/blackfriday.v2 v2.0.1 )
replace gopkg.in/russross/blackfriday.v2 => github.com/russross/blackfriday/v2 v2.0.1`
i got this message
go: github.com/russross/blackfriday/[email protected] used for two different module paths (github.com/russross/blackfriday/v2 and gopkg.in/russross/blackfriday.v2)
anything wrong?
@Mote-Z
[...] i got this message
go: github.com/russross/blackfriday/[email protected] used for two different module paths (github.com/russross/blackfriday/v2 and gopkg.in/russross/blackfriday.v2)
anything wrong?
Did you check your source files to make sure your import
s point to gopkg.in/russross/blackfriday.v2
?
@Mote-Z
[...] i got this message
go: github.com/russross/blackfriday/[email protected] used for two different module paths (github.com/russross/blackfriday/v2 and gopkg.in/russross/blackfriday.v2)
anything wrong?Did you check your source files to make sure your
import
s point togopkg.in/russross/blackfriday.v2
?
yes , first I imports "gopkg.in/russross/blackfriday.v2" and it shows me the error above , later i change all (imports and module in go.mod) to "github.com/russross/blackfriday/v2" , it worked
I'm on go version go1.15.6 windows/amd64
. Indeed, running go get github.com/russross/blackfriday/v2
did not work and caused the following:
cannot find package "github.com/russross/blackfriday/v2" in any of:
C:\Go\src\github.com\russross\blackfriday\v2 (from $GOROOT)
C:\Users\Atulya\gopath\src\github.com\russross\blackfriday\v2 (from $GOPATH)
I was able to get it working perfectly fine using:
go get gopkg.in/russross/blackfriday.v2
and importing using
import "gopkg.in/russross/blackfriday.v2"
Thanks for developing this! 👍🏼
Same issue here with Go 1.15.11 on linux/amd64 when running go get
on a project that has github.com/russross/blackfriday/v2 v2.0.1
in its go.mod
requirements (and imports the GitHub name as well). This works as a workaround:
replace github.com/russross/blackfriday/v2 => gopkg.in/russross/blackfriday.v2 v2.0.1
Considering the former is supposed to be the canonical v2 URL though, something is definitely afoul here.