Skip to content

Why use %#v and not %v? #127

@eloff

Description

@eloff

I find myself frequently comparing enum types and arrays of types, but the error message is a little obtuse:

    Error:          Not equal: []compiler.itemType{0x1, 0x2, 0x9, 0x2, 0x2, 0xa, 0xb, 0x2, 0x3, 0x0, 0x2, 0x3, 0x2, 0x3, 0xc} (expected
                            != []compiler.itemType{0x1, 0x2, 0x9, 0x2, 0x2, 0xa, 0xb, 0x2, 0x0, 0x2, 0x3, 0x2, 0x3, 0xc} (actual)

vs:

    Error:          Not equal: [Keyword Identifier StartOptions Identifier Identifier EndOptions StartFields Identifier AutoValue Identifier AutoValue Identifier AutoValue EndFields] (expected)
                            != [Keyword Identifier StartOptions Identifier Identifier EndOptions StartFields Identifier AutoValue Comment Identifier AutoValue Identifier AutoValue EndFields] (actual)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions