summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-07-21 14:40:47 +0200
committerxengineering <me@xengineering.eu>2024-07-21 14:40:47 +0200
commit8c95d2ea4b793d1f1eb4ffa85fa621318b00e8e3 (patch)
tree726e4aa93c56b84ec42b06587549b1f5ec2c556b
parentc1adc25b1d4e0190ba1e38c9f4ea468770f1bb22 (diff)
downloadcraft-8c95d2ea4b793d1f1eb4ffa85fa621318b00e8e3.tar
craft-8c95d2ea4b793d1f1eb4ffa85fa621318b00e8e3.tar.zst
craft-8c95d2ea4b793d1f1eb4ffa85fa621318b00e8e3.zip
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.
-rw-r--r--main.go2
1 files changed, 1 insertions, 1 deletions
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)