Go uses the Exit function for that. Just pass the status code as an argument and you’re done 🙂
To exit(1) with an error message you can use log.Fatal()/log.Fatalf()/log.Fatalln(): https://pkg.go.dev/log#Fatal
Go uses the Exit function for that. Just pass the status code as an argument and you’re done 🙂
To exit(1) with an error message you can use log.Fatal()/log.Fatalf()/log.Fatalln(): https://pkg.go.dev/log#Fatal