Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Go

Idiom #186 Exit program cleanly

Exit a program cleanly indicating no error to OS

import "os"
defer os.Exit(0)

defer would be used in order to run subsequent deferred statements before exiting
import "os"
os.Exit(0)
#include <stdlib.h>
exit(EXIT_SUCCESS);

New implementation...