Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
234 B

4 years ago
  1. # -*- mode: snippet -*-
  2. # name: testmain
  3. # key: testmain
  4. # contributor : @atotto
  5. # --
  6. func TestMain(m *testing.M) {
  7. setup()
  8. ret := m.Run()
  9. if ret == 0 {
  10. teardown()
  11. }
  12. os.Exit(ret)
  13. }
  14. func setup() {
  15. $1
  16. }
  17. func teardown() {
  18. $2
  19. }