Git Product home page Git Product logo

Comments (6)

Depado avatar Depado commented on June 15, 2024

Strange, it does exist 🤔

from bfchroma.

TACIXAT avatar TACIXAT commented on June 15, 2024

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.

from bfchroma.

Depado avatar Depado commented on June 15, 2024

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 ?

from bfchroma.

Depado avatar Depado commented on June 15, 2024

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 ?

from bfchroma.

pebbe avatar pebbe commented on June 15, 2024

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

from bfchroma.

Depado avatar Depado commented on June 15, 2024

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.

from bfchroma.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.