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

panic: reflect.Set: value of type *goldmark.markdown is not assignable to type []uint8 #877

Open
zapateo opened this issue Sep 21, 2021 · 0 comments
Labels
bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate RuntimeError A bug in Scriggo caused an error/panic at runtime

Comments

@zapateo
Copy link
Member

zapateo commented Sep 21, 2021

This code, executed in Scriggo, panics the runtime:

package main

import (
	"io"
	"os"

	"github.com/open2b/scriggo"
	"github.com/yuin/goldmark"
)

func main() {
	fsys := scriggo.Files{
		"index.html": []byte(`{{ markdown("*b*") }}`),
	}
	md := goldmark.New()
	opts := &scriggo.BuildOptions{
		MarkdownConverter: func(src []byte, out io.Writer) error {
			return md.Convert(src, out)
		},
	}
	template, err := scriggo.BuildTemplate(fsys, "index.html", opts)
	if err != nil {
		panic(err)
	}
	err = template.Run(os.Stdout, nil, nil)
	if err != nil {
		panic(err)
	}
}

with this error:

panic: reflect.Set: value of type *goldmark.markdown is not assignable to type []uint8

This is a bit hard to debug because here we have Scriggo embedded inside Scriggo.

@zapateo zapateo added bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate RuntimeError A bug in Scriggo caused an error/panic at runtime labels Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate RuntimeError A bug in Scriggo caused an error/panic at runtime
Projects
None yet
Development

No branches or pull requests

1 participant