defer like golang

defer like golang