fn: fix printf vet check in TestSomeToOkf Go 1.24+

See also https://github.com/golang/go/issues/60529. Now we need
to use a constant.
This commit is contained in:
ziggie committed 2026-01-13 17:31:24 +01:00
1 parent e26a114cdc
commit 7085f4706d
1 file changed
+4 -4
+4 -4
View File
@@ -20,11 +20,11 @@ func TestSomeToOk(t *testing.T) {
}
func TestSomeToOkf(t *testing.T) {
errStr := "err"
require.Equal(t, Some(1).SomeToOkf(errStr), Ok(1))
const errFmt = "missing value: %s"
require.Equal(t, Some(1).SomeToOkf(errFmt, "test"), Ok(1))
require.Equal(
t, None[uint8]().SomeToOkf(errStr),
Err[uint8](fmt.Errorf(errStr)),
t, None[uint8]().SomeToOkf(errFmt, "test"),
Err[uint8](fmt.Errorf(errFmt, "test")),
)
}