Skip to content

Possible to remove go-spew? #1061

@sapphire-janrain

Description

@sapphire-janrain

Since %#v/%+v were added to fmt (or keys now sort, or whatever the last critical change was), go-spew seems generally unnecessary (and unmaintained) these days, so thought I would start a discussion on removing it here.

Looking over the code, it doesn't look like it's critical here since you're disabling printing pointers and all. The losses would be indentation and MaxDepth as far as I can tell. For indentation, personally I prefer the compact form when checking a diff because it's very easy to see when the line changes vs trying to find it in a multiline form which requires jumping around and memorizing (or copying them to two separate files and actually using diff I guess).

Screen Shot 2021-03-10 at 17 17 54

However, one usage in assert/assertions.go actually uses difflib, so maybe json.MarshalIndent would be required for that, assuming it gets you everything you need.

For MaxDepth (in assert/assertions.go) I'm not knowledgeable enough here to say whether it matters or not. Perhaps with the representation being flat, it would matter less, but can't speak to the difflib usage wrt this.

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