Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

required package does not exist #10

Closed
pebbe opened this issue Apr 22, 2020 · 6 comments
Closed

required package does not exist #10

pebbe opened this issue Apr 22, 2020 · 6 comments

Comments

@pebbe
Copy link

pebbe commented Apr 22, 2020

this package listed in go.mod does not exist: github.com/russross/blackfriday/v2

@depado
Copy link
Owner

depado commented May 4, 2020

Strange, it does exist 🤔

@TACIXAT
Copy link

TACIXAT commented May 18, 2020

They've switched to gopkg.in/russross/blackfriday.v2. I can't go get github.com/russross/blackfriday/v2. This repo seems to use that so I get the failure too. It is odd though because play.golang.org works fine with the old url.

@depado
Copy link
Owner

depado commented May 19, 2020

It seems that issue is being discussed over here russross/blackfriday#587
I don't get why it suddenly broke.
Just out of curiosity, how are you trying to go get the v2 version ?

@depado
Copy link
Owner

depado commented May 19, 2020

So after a quick test, I can't reproduce.

// file: go.mod
module github.com/Depado/bfchromatest

go 1.14

require (
	github.com/Depado/bfchroma v1.2.0
	github.com/alecthomas/chroma v0.7.3 // indirect
	github.com/russross/blackfriday/v2 v2.0.1
)
// file: main.go
package main

import (
	"fmt"

	"github.com/Depado/bfchroma"

	bf "github.com/russross/blackfriday/v2"
)

func main() {
	md := []byte("# hello world")
	html := bf.Run([]byte(md), bf.WithRenderer(bfchroma.NewRenderer()))

	fmt.Println(string(html))
}
$ go run main.go
<h1>hello world</h1>

Even after I go get -u, it doesn't fail.
Are you both using go modules ?

@pebbe
Copy link
Author

pebbe commented May 21, 2020

Start with an empty ~/go:

$ go get -v github.com/Depado/bfchroma
github.com/Depado/bfchroma (download)
created GOPATH=/home/peter/go; see 'go help gopath'
github.com/alecthomas/chroma (download)
github.com/dlclark/regexp2 (download)
github.com/danwakefield/fnmatch (download)
github.com/russross/blackfriday (download)
package github.com/russross/blackfriday/v2: cannot find package "github.com/russross/blackfriday/v2" in any of:
        /my/opt/go/src/github.com/russross/blackfriday/v2 (from $GOROOT)
        /home/peter/go/src/github.com/russross/blackfriday/v2 (from $GOPATH)
go version go1.14.3 linux/amd64

@depado
Copy link
Owner

depado commented Jun 29, 2020

Alright, I'm completely lost, if anyone has the knowledge to help me out with this one.
I'm starting fresh with a new GOPATH every time using mktemp.

Outside of a go module project

env GOPATH=(mktemp -d -t gopath-XXXXXXXXXX) go get -v github.com/Depado/bfchroma
github.com/Depado/bfchroma (download)
github.com/alecthomas/chroma (download)
github.com/dlclark/regexp2 (download)
github.com/danwakefield/fnmatch (download)
github.com/russross/blackfriday (download)
package github.com/russross/blackfriday/v2: cannot find package "github.com/russross/blackfriday/v2" in any of:
	/home/paul/go/src/github.com/russross/blackfriday/v2 (from $GOROOT)
	/tmp/gopath-WHL5VOgK5F/src/github.com/russross/blackfriday/v2 (from $GOPATH)

Inside a go module project

I'll reuse the one described in my latest comment:

// file: go.mod
module github.com/Depado/bfchromatest

go 1.14

require (
	github.com/Depado/bfchroma v1.2.0
	github.com/alecthomas/chroma v0.7.3 // indirect
	github.com/russross/blackfriday/v2 v2.0.1
)
env GOPATH=(mktemp -d -t gopath-XXXXXXXXXX) go get -v github.com/Depado/bfchroma
go: downloading github.com/Depado/bfchroma v1.2.0
go: downloading github.com/alecthomas/chroma v0.7.3
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/dlclark/regexp2 v1.2.0
go: downloading github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
github.com/danwakefield/fnmatch
github.com/shurcooL/sanitized_anchor_name
github.com/dlclark/regexp2/syntax
github.com/russross/blackfriday/v2
github.com/dlclark/regexp2
github.com/alecthomas/chroma
github.com/alecthomas/chroma/lexers/internal
github.com/alecthomas/chroma/formatters/html
github.com/alecthomas/chroma/styles
github.com/alecthomas/chroma/lexers/b
github.com/alecthomas/chroma/lexers/a
github.com/alecthomas/chroma/lexers/p
github.com/alecthomas/chroma/lexers/e
github.com/alecthomas/chroma/lexers/j
github.com/alecthomas/chroma/lexers/f
github.com/alecthomas/chroma/lexers/i
github.com/alecthomas/chroma/lexers/k
github.com/alecthomas/chroma/lexers/l
github.com/alecthomas/chroma/lexers/n
github.com/alecthomas/chroma/lexers/o
github.com/alecthomas/chroma/lexers/q
github.com/alecthomas/chroma/lexers/r
github.com/alecthomas/chroma/lexers/d
github.com/alecthomas/chroma/lexers/t
github.com/alecthomas/chroma/lexers/w
github.com/alecthomas/chroma/lexers/x
github.com/alecthomas/chroma/lexers/y
github.com/alecthomas/chroma/lexers/v
github.com/alecthomas/chroma/lexers/c
github.com/alecthomas/chroma/lexers/h
github.com/alecthomas/chroma/lexers/circular
github.com/alecthomas/chroma/lexers/g
github.com/alecthomas/chroma/lexers/m
github.com/alecthomas/chroma/lexers/s
github.com/alecthomas/chroma/lexers
github.com/Depado/bfchroma

I can't seem to figure out the difference between go geting a package inside a project and go geting a package outside of a project. I tried ensuring this is the latest version of the repo using @master when go getting but that doesn't change anything since master points to the v1.2.0 release anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants