I’m using Go1.13. My project used gopkg.in/russross/blackfriday.v2 and before I initialized modules it worked. When modules was initialized by go mod init the project cannot run. I’ve go the following error:
Have you tried following the instructions from the README to import directly from github:
It is go get -able via via gopkg.in at gopkg.in/russross/blackfriday.v2 , but we highly recommend using package management tool like [dep][7] or [Glide][8] and make use of semantic versioning. With package management you should import github.com/russross/blackfriday and specify that you’re using version 2.0.0.
Well, if gopackages is intended to replace all of those 3rd party dependency tools is not it overhaed to keep into the project another package management tool alogside with gopackages?
I would rather will find another option to replace that blackfriday if they even aren’t able to provide a usable mechanism to use the package.
Go modules got “invented” to obselete all those third party solutions, yes. Anyway, those that used gopkg.in or other third party solutions have decided to support it a long time ago and now pay the additional cost of legacy maintenance at least for a transition phase that can take several years, until go prior to 1.12 has disappeared from living linux distributions.
Tech debts, legacy support… Known concepts and big problems in the world of IT and hard to solve…
And I haven’t tried that package[*], but as you are already using go modules, have you tried to just use blackfriday by importing it from GitHub rather than gopkg.in?
[*] My current machine hasn’t a recent go available.
edit
And if you really have problems even using GitHub imports to get it running with Go modules, feel free to open a ticket at their repository. Go modules will eventually replace all other tools, as it is the officially provided tool. Everything else will remain a crutch…
Your IP suggests you are using go modules, go modules is a tool to manage dependency versions, and the README asks you to import from GitHub when using such a tool. So have you tried importing from GitHub?
Well, you fork the mdtopdf project and change all imports of blackfriday to its GitHub equivalent, while also changing all internal imports to your fork.