alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

tests: Use t.TempDir()

Open ultrotter opened this issue 1 month ago • 1 comments

A lot of tests create temporary files. Only one cleans up. Use t.TempDir() in the CreateTemp calls, to get automatic cleanup.

Signed-off-by: Guido Trotter [email protected]

ultrotter avatar Nov 13 '25 08:11 ultrotter

Don't know if there was/is actually a reason to not use t.TempDir(). But looks like an improvement to me

Well it was added in 2020, and alertmanager is older. Maybe nobody thought about adding it?

ultrotter avatar Nov 13 '25 12:11 ultrotter