Skip to content

CBOR and panic on IntValue from OptionContentFormat #92

Open
@ptone

Description

I'm trying to work with CBOR which is missing as a media type constant, but is currently value 60 in the registry.

But when trying to get the IntValue of

msg.GetOption(canopus.OptionContentFormat)

I get a panic

panic: interface conversion: interface {} is uint32, not int

goroutine 27 [running]:
github.com/zubairhamed/canopus.(*CoapOption).IntValue(0xc42000c280, 0x1)
	/Users/ptone/Projects/code/go/src/github.com/zubairhamed/canopus/options.go:48 +0x62
main.main.func6(0x43dcf40, 0xc420018390, 0x0, 0x0)

replicated simply as
https://play.golang.org/p/s03CZymM0c

This is coming from the Copper Firefox extension when setting the Content Format setting in the debug panel

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions