Skip to content

Question: Make assertions on structs having Decimal as field on libraries like gomock? #396

@denizgursoy

Description

@denizgursoy

Hello,
I use gomock and I make some assertions on a struct that has decimal fields.

type MyType struct {
		Field1 string
		Decimal decimal.Decimal
	}

Assertions on a type like this always fail in gomock probably because of exp or precisson. Is there an already solution? My solution was to marshal to JSON and compare

Thanks

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