kinbiko / jsonassert

A Go test assertion library for verifying that two representations of JSON are semantically equal
MIT License
125 stars 16 forks source link

[Feature Request] Add `Assert` function. #45

Open l0kix2 opened 1 month ago

l0kix2 commented 1 month ago

What problem are you trying to solve?

It seems since go 1.23.0 go vet has new warning

printf: non-constant format string in call to (*github.com/kinbiko/jsonassert.Asserter).Assertf (govet)
    ja.Assertf(
...

if format-like function is used without var args.
Since jsonasert only has Assertf(not Assert) it is also used if no arguments need to be passed govet warns for all such Assertf usages and I haven't find a way to configure govet/printf linter to ignore particular Assertf function.

Maybe correct way here is to have Assert function for such cases.

kinbiko commented 1 month ago

Thank you very much for reporting this. I'm sure to be bitten by this myself, so I'll consider adding it after I've had a chance to look into the govet issue myself.