Skip to content

Instantly share code, notes, and snippets.

View kuuyee's full-sized avatar
🏠
Working from home

光子 kuuyee

🏠
Working from home
  • 能源电力
  • Beijing China
View GitHub Profile
@philpennock
philpennock / exit_check.go
Created October 24, 2012 19:59
Showing interactions of defer, os.Exit and panic in Golang.
package main
import (
"container/list"
"flag"
"fmt"
"os"
"sync"
"time"
)
@perillo
perillo / atexit.go
Last active November 17, 2015 09:17
// Copyright 2015 Manlio Perillo. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// Package atexit implements support for running deferred functions in case of
// abnormal exit (in contrast to a normal exit when the program returns from
// the main function).
//
// Since calling os.Exit, e.g. during a signal handler, does not call deferred
// functions, a complementary mechanism is required when the program acquires