russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.42k stars 598 forks source link

installation issue - not sure what #583

Open ORESoftware opened 4 years ago

ORESoftware commented 4 years ago

looks like this is a dep of a dep in our project...when running go run . it's doing some go find/gets and we get:

cm safe push: gopkg.in/russross/blackfriday.v2: go.mod has non-....v2 module path "github.com/russross/blackfriday/v2" at revision v2.0.1

that causes an error in our build, not sure why

cbednarski commented 4 years ago

I ran into this yesterday using blackfriday as a top-level dependency. The error is not very helpful but what it means is that go.mod file's require stanza should reflect what is used in blackfriday's go.mod module stanza.

e.g. https://github.com/russross/blackfriday/blob/v2/go.mod has:

module github.com/russross/blackfriday/v2

So go.mod should have:

require (
    github.com/russross/blackfriday/v2 v2.0.1 // indirect
    ...
)

Since it's a transitive dependency in your case I'm not sure changing this in your go.mod will fix it. It might be you need your dependency to fix their mod file instead. go modules are a small disaster.

mwat56 commented 4 years ago

[...] go modules are a small disaster.

Small correction: improper use of go modules (as blackfriday does: Issue 500 ) can cause small desasters. See: Using Go Modules

isurzhenko commented 4 years ago

Try this one (as recommended in readme): gopkg.in/russross/blackfriday.v2 v2.0.1