Say, I had the following code that prints some log messages. How would I go about testing that the correct messages have been logged? As log.Fatal calls o
You cannot and you should not.
This "you must 'test' each and every line"-attitude is strange, especially for terminal conditions and that's what log.Fatal is for.
(Or just test it from the outside.)