Skip to content

bug: complete TinyGo workaround for encode #686

@seedhammer

Description

@seedhammer

What version of fxamacker/cbor are you using?

feature/cbor-tinygo-beta

Does this issue reproduce with the latest release?

N/A

What OS and CPU architecture are you using (go env)?

TinyGo v0.38.0

What did you do?

Using the Marshal method to encode a Go value into CBOR.

What did you expect to see?

No panics.

What did you see instead?

On TinyGo, I sometimes see "reflect: unimplemented: AssignableTo with interface" panics. Not always, presumably because of build time optimizations by TinyGo.

FWIW, I've hacked together a change on top of the feature/cbor/cbor-tinygo-beta branch that seems to fix my issues: seedhammer@1e5ed28. It just blindly replaces calls to reflect.Type.Implements with the implements function specialized for TinyGo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TinyGoTinyGo compatibility

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions