From 8c95d2ea4b793d1f1eb4ffa85fa621318b00e8e3 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 21 Jul 2024 14:40:47 +0200 Subject: Switch order of startup and exit log message While the exit log message is prefixed with `defer` and thus called at the end of the main function it is in theory possible that the startup log message fails. This would result in a exit message without startup message which is confusing. Furthermore it is not intuitive while reading the code to see the exit message first. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 6408a4a..84d1032 100644 --- a/main.go +++ b/main.go @@ -25,8 +25,8 @@ func main() { log.SetFlags(0) - defer log.Println("Exiting craft") log.Println("Starting craft") + defer log.Println("Exiting craft") workbench := prepareWorkbench(repo, commit) defer os.RemoveAll(workbench) -- cgit v1.2.3-70-g09d2