yuin / goldmark

:trophy: A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.
MIT License
3.68k stars 255 forks source link

util: package fails to build with GOOS=js GOARCH=wasm #120

Closed bcmills closed 4 years ago

bcmills commented 4 years ago
  1. What version of goldmark are you using?

v1.1.26

  1. What version of Go are you using?

Current Go 1.15 development tree (see golang/go#38183).

  1. What operating system and processor architecture are you using? :

    GOOS=js
    GOARCH=wasm
  2. What did you do?

example.com$ go version
go version devel +d98023eb Tue Mar 31 04:31:04 2020 +0000 linux/amd64

example.com$ go mod init example.com
go: creating new go.mod: module example.com

example.com$ go get -d github.com/yuin/goldmark@latest
go: downloading github.com/yuin/goldmark v1.1.26
go: github.com/yuin/goldmark latest => v1.1.26

example.com$ GOOS=js GOARCH=wasm go build github.com/yuin/goldmark
# github.com/yuin/goldmark/util
../_gopath/pkg/mod/github.com/yuin/goldmark@v1.1.26/util/util.go:566:34: undefined: BytesToReadOnlyString
../_gopath/pkg/mod/github.com/yuin/goldmark@v1.1.26/util/util.go:578:34: undefined: BytesToReadOnlyString
../_gopath/pkg/mod/github.com/yuin/goldmark@v1.1.26/util/util.go:611:14: undefined: BytesToReadOnlyString
../_gopath/pkg/mod/github.com/yuin/goldmark@v1.1.26/util/util.go:686:13: undefined: StringToReadOnlyBytes
  1. What did you expect to see?

A successful build.

  1. What did you see instead?

A build failure.

  1. Did you confirm your output is different from CommonMark online demo or other official renderer correspond with an extension?

Not applicable. (Problem does not relate to rendering output.)

bcmills commented 4 years ago

Note that the fix was tagged 1.1.27 rather than v1.1.27, so the go command sees it as a pre-release (pseudo-version) rather than a release.

(It's usable if I go get the commit explicitly, but not the default for go get yet.)