diff options
author | xengineering <me@xengineering.eu> | 2024-07-21 14:40:47 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-07-21 14:40:47 +0200 |
commit | 8c95d2ea4b793d1f1eb4ffa85fa621318b00e8e3 (patch) | |
tree | 726e4aa93c56b84ec42b06587549b1f5ec2c556b | |
parent | c1adc25b1d4e0190ba1e38c9f4ea468770f1bb22 (diff) | |
download | craft-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.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |