Initial commit.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: testmain
|
||||
# key: testmain
|
||||
# contributor : @atotto
|
||||
# --
|
||||
func TestMain(m *testing.M) {
|
||||
setup()
|
||||
ret := m.Run()
|
||||
if ret == 0 {
|
||||
teardown()
|
||||
}
|
||||
os.Exit(ret)
|
||||
}
|
||||
|
||||
func setup() {
|
||||
$1
|
||||
}
|
||||
|
||||
func teardown() {
|
||||
$2
|
||||
}
|
Reference in New Issue
Block a user